values. Pick a non-empty set of positions and add up the numbers there. How many such sets have an odd total?
Two sets that differ in at least one position are counted separately, even if their numbers are equal.
Return the answer modulo 10⁹ + 7.values=[3, 4] → 2
[3] and [3, 4] (sum 7) have odd sums. [4] has an even sum.
values=[2, 8, 6] → 0
All the numbers are even, so every sum of them is even too.
values=[5, 5, 5] → 4
The three single-5 picks and the pick of all three (sum 15) are odd: 4 in total.
values=[3, 4]
2
Run checks the first 3 tests in your browser. Submit checks all 91 tests on the server, hidden ones included.