values. In one move you may pick any element and switch off any set of its 1-bits (turn them into zeros). You can never switch a bit on. You may make as many moves as you like, including none.
Return the largest value the XOR of all elements can reach after your moves.values=[5, 6, 3] → 7
As is, 5 XOR 6 XOR 3 = 0. Turn off bit 2 of 6 (it becomes 2) and bit 1 of 3 (it becomes 1): 5 XOR 2 XOR 1 = 7.
values=[8, 8, 8, 8] → 8
Zero out three of the four 8s; one is left and the XOR is 8.
values=[0] → 0
values=[5, 6, 3]
7
Run checks the first 3 tests in your browser. Submit checks all 86 tests on the server, hidden ones included.