首页 > 代码库 > LeetCode.540.Single Element in a Sorted Array

LeetCode.540.Single Element in a Sorted Array

技术分享

 

恩, 沙比提

 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         

 

LeetCode.540.Single Element in a Sorted Array