是136题的加强版,这次是每个数重复三次.
重复两次用一个bit记录一下,重复三次就用两个记录.很简单.
class Solution(object): def singleNumber(self, nums): """ :type nums: List[int] :rtype: int """ a,b=0,0 for c in nums: a=(a^c)&~b b=(b^c)&~a return a