leetcode/0136_single-number/python3/solution.py

6 lines
146 B
Python
Raw Normal View History

2022-04-25 20:56:40 +00:00
from functools import reduce
class Solution:
def singleNumber(self, nums: List[int]) -> int:
return reduce(lambda r, a: r ^ a, nums)