Difficulty: Hard
https://leetcode.com/problems/single-number/submissions/
The code is shown below:
class Solution:
def singleNumber(self, nums: List[int]) -> int:
res = 0
for num in nums:
res ^= num
return res