Two Lonely Numbers — Solution & Editorial
XOR of everything equals x⊕y, which is non-zero; pick any set bit of it (the lowest works) and split the array by that bit — each part contains exactly one singleton, recoverable by XOR.
Complexity: O(N)
XOR of everything equals x⊕y, which is non-zero; pick any set bit of it (the lowest works) and split the array by that bit — each part contains exactly one singleton, recoverable by XOR.
Complexity: O(N)