1import math234class Solution(object):5def singleNumber(self, nums):6"""7:type nums: List[int]8:rtype: int9[0,-1,1,0]1011[2,2,3,2]12[2,2,3,2]13[2,2,3,2]1410 10 11 1015"""16total = sum(nums)1718uniqueTotals = set()19while nums:20uniqueTotals.add(nums.pop())21return (sum(uniqueTotals) * 3 - total) / 2