values of positive integers.
A number is *square-free* if no perfect square other than 1 divides it (for example, 30 is square-free, while 12 = 4 · 3 is not).
A pick is a non-empty set of positions in the array. Two picks are different if their sets of positions differ, even when the values at those positions are the same.
Return the number of picks whose product is square-free. The answer can be large, so return it modulo 10⁹ + 7.values=[2, 6, 9, 5] → 5.0
9 = 3² is out at once. From 2, 6 and 5 the valid picks are {2}, {6}, {5}, {2, 5}, {6, 5}; {2, 6} gives 12, which is divisible by 4. That makes 5.
values=[1, 1, 7] → 7.0
Ones never cause trouble, so every non-empty pick works: 2³ − 1 = 7.
values=[4, 8, 25] → 0.0
values=[2, 6, 9, 5]
5.0
Run checks the first 3 tests in your browser. Submit checks all 60 tests on the server, hidden ones included.