Map an array to 1 << A[i]
and then XOR everything together. Your duplicates will be the numbers where corresponding bit is off.
Hauleth
- 101
- 2