You are viewing a single comment's thread. Return to all comments →
Python solution using dictionary instead of Counter method
def lonelyinteger(a): count = {} for i in a: if i in count: count[i] += 1 else: count[i] = 1 out = [ele for ele in count.keys() if count[ele] == 1][0] return out
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 →
Python solution using dictionary instead of Counter method