You are viewing a single comment's thread. Return to all comments →
def lonelyinteger(a): unique=0 for i in a: unique=i^unique return unique
explanation : a^a=0 a^0=a...so if the element is unique we get the element as the result
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 →
explanation : a^a=0 a^0=a...so if the element is unique we get the element as the result