Single Number
Input: [2,2,1]
Output: 1Input: [4,1,2,1,2]
Output: 4Hash Table
Bit Manipulation
If we take XOR of zero and some bit, it will return that bit
a⊕0=a
If we take XOR of two same bits, it will return 0
a⊕a=0
a⊕b⊕a=(a⊕a)⊕b=0⊕b=bSolution
Reference
Last updated