We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Lonely Integer
- Discussions
Lonely Integer
Lonely Integer
Sort by
recency
|
893 Discussions
|
Please Login in order to post a comment
def lonelyinteger(a): for i in a: if a.count(i)==1: return i
This is a simple solution in python, reduce applies a accumulative operation to all elements in the list into a single value Python:
Single line js solution:
golang solution using XOR: