| 53 | ''' |
| 54 | |
| 55 | class Solution: |
| 56 | def singleNumber(self, nums: List[int]) -> List[int]: |
| 57 | xor = reduce(lambda x,y: x^y, nums, 0) #complete xor of list will result in xor of these two unique elements |
| 58 | xor = xor&(-xor) |
| 59 | first = second = 0 |
| 60 | for num in nums: |
| 61 | if xor & num: |
| 62 | first ^= num |
| 63 | else: |
| 64 | second ^= num |
| 65 | return [first, second] |
nothing calls this directly
no outgoing calls
no test coverage detected