使用异或计算即可
# # # @param A int整型一维数组 # @return int整型 # class Solution: def singleNumber(self , A ): # write code here res = 0 for i in range(len(A)): res^=A[i] return res
使用异或计算即可
# # # @param A int整型一维数组 # @return int整型 # class Solution: def singleNumber(self , A ): # write code here res = 0 for i in range(len(A)): res^=A[i] return res