题解 | #出现一次的数字#
出现一次的数字
http://www.nowcoder.com/practice/0bc646909e474ac5b031ec6836a47768
使用异或计算即可
#
#
# @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 
