class Solution:
def singleNumber(self, nums: List[int]) -> List[int]:
ans, a, b = 0, 0, 0
for n in nums:
ans ^= n
ans = ans & (1-ans) ## find the least significant 1
for n in nums:
if n&ans:
a ^= n
else:
b ^= n
return [a,b]