You are viewing a single comment's thread. Return to all comments →
a^a = 0 and a^0 = a so if you have an element repeated 2n times, it's xor is 0. and the lonely element remains as it is.
Lonely Integer
You are viewing a single comment's thread. Return to all comments →
a^a = 0
and a^0 = a
so if you have an element repeated 2n times, it's xor is 0. and the lonely element remains as it is.