You are viewing a single comment's thread. Return to all comments →
Simply XOR should solve this problem with just O(n) time complexity and O(1) space complexity.
num = 0 for i in a: num ^=i return num
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 →
Simply XOR should solve this problem with just O(n) time complexity and O(1) space complexity.
num = 0 for i in a: num ^=i return num