O(N) solution for python, using set one liner code can be used alternatively


#1
def singleNumber(self, A):
    ele = A[0]
    for i in range(1,len(A)):
        ele ^= A[i]
    return ele