Mental Model
Use XOR to cancel out pairs and isolate two unique numbers by splitting based on a differing bit.
Analogy: Imagine you have pairs of socks mixed in a drawer, except two socks have no pair. By checking a unique feature (like color stripe), you separate socks into two groups and find the unmatched ones easily.
Array: [2, 3, 7, 9, 2, 3] Unique elements: 7 and 9 XOR all: 2 ⊕ 3 ⊕ 7 ⊕ 9 ⊕ 2 ⊕ 3 = 7 ⊕ 9 = 14 (1110) Split by rightmost set bit of XOR result: Group 1 (bit set): [7] -> 7 Group 2 (bit not set): [2, 3, 9, 2, 3] -> 9
