Given an integer n, return true if n has exactly three distinct positive divisors. Otherwise, return false. A divisor of n is a positive integer that divides n without leaving a remainder.
You are given a positive integer p. Consider an array nums (1-indexed) that consists of the integers in the inclusive range [1, 2p - 1] represented in binary form. You are allowed to perform the following operation any number of times: Choose two elements x and y from nums. Choose a bit in x and swap it with its corresponding bit in y. The goal is to find the minimum non-zero product of the elements in nums after performing the above operation any number of times. Return this minimum product modulo (10^9 + 7).
You are given a list of rectangles, each represented by its width and height. Two rectangles are interchangeable if their width-to-height ratios are the same. Your task is to return the number of interchangeable rectangle pairs in the list.
You are given an array of m observations, each representing a die roll from a 6-sided die, and an average value mean of all n + m rolls. Your task is to calculate the missing n observations such that the overall average of all n + m rolls equals the provided mean. If multiple valid answers exist, return any of them. If it is impossible to achieve the desired average, return an empty array.
Alice and Bob are playing a game with stones. The sequence of n stones has values given in an array stones. Players take turns to remove a stone. The player who removes a stone, making the sum of all removed stones divisible by 3, loses. If all stones are removed, Bob wins automatically. Determine if Alice wins or Bob wins, assuming both play optimally.