Mental Model
XOR of a number with itself is zero, and XOR with zero is the number itself. So XORing all numbers cancels out duplicates, leaving the unique one.
Analogy: Imagine you have pairs of socks in a drawer. If you take out all socks and pair them up, the one sock left without a pair is the unique one.
Array: [2, 3, 2, 4, 3] XOR process: 0 ⊕ 2 -> 2 2 ⊕ 3 -> 1 1 ⊕ 2 -> 3 3 ⊕ 4 -> 7 7 ⊕ 3 -> 4 Result: 4 (unique element)
