Given a list of numbers, find and print the elements that appear in the list only once
example
input:
4 3 5 2 5 1 3 5
output:
1
2
4
example
input:
4 3 5 2 5 1 3 5
output:
1
2
4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import Counter | |
a = [int(x) for x in input().split()] | |
c=Counter(a) | |
for key in c.keys(): | |
if c[key]==1:print(key) |