findTheNumberThatAppearsOnceAndOtherNumbersTwice()Think of matching socks. Every pair gets tossed into the laundry basket together. The one odd sock left alone on the table is your answer.
Register = 0 ^ 4 = 4.
### The Mission Imagine a masquerade ballroom where everyone came in pairs wearing identical masks, except for **one single guest** who came alone! Given an array of integers where every number appears exactly twice except for one number that appears only once, identify the lone survivor. ### The XOR Magic Trick Any number XORed with itself cancels out to zero (`x ^ x = 0`). Any number XORed with zero stays itself (`x ^ 0 = x`). If you XOR every number together across the room, all pairs vaporize into zero, leaving **only the lone guest standing** in **O(N)** time and **O(1)** memory!