136.Single Number

 

 

class Solution:
    def singleNumber(self, nums: List[int]) -> int:
        a = 0
        for i in range(len(nums)):
            a = a^nums[i]
        return a

 

posted @ 2020-05-09 14:58  星海寻梦233  阅读(79)  评论(0编辑  收藏  举报