用更加好懂的状态机做
class Solution(object):
def findNumberAppearingOnce(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
ones=0
twos=0
for n in nums:
one=ones
ones=(ones&(~twos)&(~n))|((~ones)&(twos)&(n))
twos=((~one)&(~twos)&(n))|((~one)&(twos)&(~n))
return twos
6