values of length n. For any triple of indices (i, j, k), each from 0 to n - 1 and allowed to repeat, define its mix as
(values[i] | values[j]) & values[k]
where | is bitwise OR and & is bitwise AND. There are n³ triples in total. Return the bitwise XOR of the mixes of all of them.values=[3, 5] → 6
There are 2³ = 8 triples: (3|3)&3 = 3, (3|3)&5 = 1, (3|5)&3 = 3, (3|5)&5 = 5, (5|3)&3 = 3, (5|3)&5 = 5, (5|5)&3 = 1, (5|5)&5 = 5. The XOR of all eight is 6.
values=[12] → 12
The only triple (0, 0, 0) gives (12 | 12) & 12 = 12.
values=[7, 7, 2] → 2
values=[3, 5]
6
Run checks the first 3 tests in your browser. Submit checks all 83 tests on the server, hidden ones included.