You are viewing a single comment's thread. Return to all comments →
The XOR operation will produce 0 for every doubled number. Only a single number will left.
def lonelyinteger(a): res = 0 for item in a: res ^= item return res
Seems like cookies are disabled on this browser, please enable them to open this website
Lonely Integer
You are viewing a single comment's thread. Return to all comments →
The XOR operation will produce 0 for every doubled number. Only a single number will left.