Introduction
1. Hash Table
class Solution(object):
def singleNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
m = {}
for i in nums:
if m.get(i):
del m[i]
else:
m[i] = 1
return m.keys()[0]2. XOR
Last updated