好像沒有越界溢出,所以沒有負數(shù)?
from functools import reduce
class Solution:
def singleNumber(self, nums: List[int]) -> int:
return reduce(lambda x,y:x^y,nums)
好像沒有越界溢出,所以沒有負數(shù)?
from functools import reduce
class Solution:
def singleNumber(self, nums: List[int]) -> int:
return reduce(lambda x,y:x^y,nums)