class Solution:
def singleNumbers(self, nums: List[int]) -> List[int]:
res = functools.reduce(lambda x, y: x ^ y, nums)
inter = 1
while inter & res == 0:
inter <<= 1
a, b = 0, 0
for num in nums:
if num & inter == 0:
a ^= num
else:
b ^= num
return [a, b]