恩, 沙比提
1 class Solution(object): 2 def singleNonDuplicate(self, nums): 3 """ 4 :type nums: List[int] 5 :rtype: int 6 """ 7 xorsum = 0 8 for i in nums: 9 xorsum = xorsum ^ i 10 return xorsum 11
时间: 2024-10-07 23:41:41
恩, 沙比提
1 class Solution(object): 2 def singleNonDuplicate(self, nums): 3 """ 4 :type nums: List[int] 5 :rtype: int 6 """ 7 xorsum = 0 8 for i in nums: 9 xorsum = xorsum ^ i 10 return xorsum 11