first, second and third. A triple picks one element from each list: first[i], second[j], third[k].
For a triple, take the bitwise XOR of its three numbers and count the ones in its binary form. The triple is good if that count is even (zero is even).
Return the number of good triples. Triples with different indices are counted separately even if they hold the same numbers.first=[4], second=[7], third=[1] → 0
The only triple gives 4 XOR 7 XOR 1 = 2, which is 10 in binary: one set bit, an odd count. The answer is 0.
first=[0, 3], second=[5], third=[6, 1] → 2
0^5^6 = 3 (11, two set bits) counts; 0^5^1 = 4 (100) does not; 3^5^6 = 0 (zero set bits) counts; 3^5^1 = 7 (111) does not. The answer is 2.
first=[1, 2], second=[3, 3], third=[0] → 0
first=[4], second=[7], third=[1]
0
Run checks the first 3 tests in your browser. Submit checks all 55 tests on the server, hidden ones included.