Life is short.
class Solution(object): def findNumberAppearingOnce(self, nums): a = b = 0 for n in nums: a = (a ^ n) & ~b b = (b ^ n) & ~a return a