Tap here to switch tabs
Problem
Submissions

Problem: Count Triplets with Even XOR Set Bits II

Count Triplets with Even XOR Set Bits II gives three integer arrays. Return the number of one-from-each selections whose XOR has an even number of set bits.

Statement

Given three integer arrays a, b, and c, return the number of triplets (i, j, k) such that the bitwise XOR sum a[i] ^ b[j] ^ c[k] contains an even number of set bits in its binary representation.

Constraints:

  • 1≤1 \leq a.length, b.length, c.length ≤105\leq 10^5

  • 0≤0 \leq a[i], b[i], c[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Triplets with Even XOR Set Bits II

Count Triplets with Even XOR Set Bits II gives three integer arrays. Return the number of one-from-each selections whose XOR has an even number of set bits.

Statement

Given three integer arrays a, b, and c, return the number of triplets (i, j, k) such that the bitwise XOR sum a[i] ^ b[j] ^ c[k] contains an even number of set bits in its binary representation.

Constraints:

  • 1≤1 \leq a.length, b.length, c.length ≤105\leq 10^5

  • 0≤0 \leq a[i], b[i], c[i] ≤109\leq 10^9