'''
a = 0
b = 0
for i in range(len(nums)):
c = nums[i]
a1 = (a&~b&~c) | (~a&b&c)
b1 = (~a&~b&c) | (~a&b&~c)
a = a1
b = b1
return a|b
'''
Basically, the solution comes from @ziyihao , great thanks
'''
a = 0
b = 0
for i in range(len(nums)):
c = nums[i]
a1 = (a&~b&~c) | (~a&b&c)
b1 = (~a&~b&c) | (~a&b&~c)
a = a1
b = b1
return a|b
'''
Basically, the solution comes from @ziyihao , great thanks