values. You may pick any non-empty set of its elements and take the bitwise OR of the picked numbers.
Find the largest OR any pick can reach and return how many picks reach it. Picks are told apart by the positions of the chosen elements: if two equal numbers sit at different positions, taking one or the other gives two different picks.values=[4, 2, 6] → 5
The largest possible OR is 6. It comes from [6], [4, 2], [4, 6], [2, 6] and [4, 2, 6], five picks in total.
values=[9, 9] → 3
Every non-empty pick gives 9: the first 9, the second 9, and both. Equal values at different positions count as different picks.
values=[1, 2, 4, 8] → 1
values=[4, 2, 6]
5
Run checks the first 3 tests in your browser. Submit checks all 110 tests on the server, hidden ones included.