first, second and third. Take one element from each, first[i], second[j] and third[k], and compute their bitwise XOR.
Return the number of index triples (i, j, k) for which that XOR has an **even** number of set bits in binary (zero set bits counts as even).first=[5], second=[6], third=[3] → 1
5 ^ 6 ^ 3 = 0, which has zero set bits, an even number. The answer is 1.
first=[1, 2], second=[4], third=[0, 7] → 2
Check all four: 1 ^ 4 ^ 0 = 5 (two bits, yes), 1 ^ 4 ^ 7 = 2 (one bit, no), 2 ^ 4 ^ 0 = 6 (two bits, yes), 2 ^ 4 ^ 7 = 1 (no). The answer is 2.
first=[3, 8, 0], second=[1, 1], third=[12, 5, 9] → 6
first=[5], second=[6], third=[3]
1
Run checks the first 3 tests in your browser. Submit checks all 67 tests on the server, hidden ones included.