T.V. NAGARAJU TECHNICAL SOLUTIONS
Pages
Home
Online Courses
Tutorials
Operating Systems
C -Excercises
Python Excercises
JAVA Exercises
Placement Papers
Lab Programs
Python Programs
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
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment