from collections import defaultdict
def solution(A):
# write your code in Python 3.6
storage = []
A.sort()
for a in A:
if a not in storage:
storage.append(a)
else :
storage.remove(a)
return storage[0]
def test3(A):
if len(A) == 1:
return A[0]
A = sorted(A)
print(A)
for i in range(0, len(A), 2):
if i+1 == len(A):
return A[i]
if A[i] != A[i+1]:
return A[i]
test3([1,2,1,2,3])
def solution(A):
return reduce(lambda x,y: x^y, A)