Approach hintTry it first, then revealHide
The XOR of all numbers equals a ^ b, which is non-zero. Any set bit of that value splits the input into two groups with a and b on different sides, and XOR within each group isolates them.
The XOR of all numbers equals a ^ b, which is non-zero. Any set bit of that value splits the input into two groups with a and b on different sides, and XOR within each group isolates them.