```
def singleNumber(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
nums.sort()
for i in range(0,len(nums),2):
if (i != len(nums) - 1) and (nums[i] != nums[i+1]):
return nums[i]
elif i == len(nums) - 1:
return nums[i]
```