python解法如下:

n = input()
nums = input().split()
res=int(nums[0])
for i in range(1,len(nums)):
res=res^int(nums[i])
print(res)