Hey guys, just for your information.
class Solution(object):
def singleNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
nums.sort()
return list(set(nums) - set(nums[1::2]))[0]
@Supreme_Lei
You should have O(n) time complexity and try not to use extra memory. Your complexity is O(n*log n) and you have 2 sets, which use extra memory.