Mental Model
Use XOR to cancel out pairs and isolate two unique numbers by splitting the array into two groups based on a set bit.
Analogy: Imagine you have pairs of socks mixed with two unique socks. By shaking the pile and separating socks by a unique thread color, you can find the two unmatched socks easily.
Array: [2, 3, 7, 9, 2, 3] XOR all: 7 ⊕ 9 = ? Split by set bit: Group 1: numbers with bit set -> 7 Group 2: numbers without bit set -> 9
