6 lines
146 B
Python
6 lines
146 B
Python
|
from functools import reduce
|
||
|
|
||
|
class Solution:
|
||
|
def singleNumber(self, nums: List[int]) -> int:
|
||
|
return reduce(lambda r, a: r ^ a, nums)
|