Mental Model
Use XOR to cancel out pairs and find two unique numbers by splitting the array into two groups based on a set bit.
Analogy: Imagine you have pairs of socks mixed in a drawer, except two socks don't have a pair. By shaking the drawer and separating socks by a unique feature (like color), you find the two unmatched socks.
Array: [2, 3, 7, 9, 2, 3] Unique elements: 7 and 9 XOR all elements -> xor = 14 Find rightmost set bit in xor -> mask = 2 (binary 0010) Split array into two groups by mask bit Group 1: elements with bit set [2, 3, 7, 2, 3] Group 2: elements without bit set [9] XOR each group separately to find unique elements: 7 and 9
