Write a program to find the number occurring odd number of times in an array.

 

All numbers occur even number of times except one number which occurs odd number of times.



a=list(map(int,input().split()))
ans=0
for i in a:
    ans=ans^i
print(ans)

Input:

 8 3 8 5 4 3 4 3 5
Output
 3

No comments:

Post a Comment