Add Two Numbers @ LeetCode (Python)
Merge k Sorted Lists @ LeetCode (Python)

Single Number @ LeetCode (Python)

kitt posted @ 2014年2月13日 19:07 in LeetCode , 2033 阅读

异或

class Solution:
    # @param A, a list of integer
    # @return an integer
    def singleNumber(self, A):
        res = 0
        for i in A: res ^= i
        return res

登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter