single-number py3

This commit is contained in:
2022-04-26 02:26:40 +05:30
parent 041a3d1c49
commit 6450ef0347
2 changed files with 34 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
from functools import reduce
class Solution:
def singleNumber(self, nums: List[int]) -> int:
return reduce(lambda r, a: r ^ a, nums)