Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
If <code>x</code> and <code>y</code> both have an even number of set bits, how many set bits do their XOR have?
If exactly one of <code>x</code> and <code>y</code> has an even number of set bits, how many set bits do their XOR have?
Conclude that if the XOR of three elements would have an even number of set bits, an even number of them (0 or 2) should have an odd number of set bits!
For each array count the number of elements that have even set bits and also count the ones that have odd set bits.