Question #265951

Given some space separated list of integers every element appears twice other than one element write a program to find the element which appeared only once

Expert's answer

lst = [int(n) for n in input().split()]
while lst:
    n = lst.pop(0)
    if n in lst:
        lst.remove(n)
    else:
        print(n)
        break

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS