Answer to Question #317289 in Python for babu

Question #317289

question: single entry



akshya is given a list of N integers. Each number in the list appears exactly for one number. help akshya by identifying the numbers which appeared exactly once in the list.



input:-



2 2 1



output:-



1



input:



8 9 2 8 9 2 5



output:



5



explanation:



in the example the given integers are 2 2 1 as the number 1 has appeared only once.


so the output should be 1.




1
Expert's answer
2022-03-24T10:39:27-0400
cnt = [0] * 10
print("Enter list of integers:")
arr = input().split()
for i in range(len(arr)):
    arr[i] = int(arr[i])
    cnt[arr[i]] += 1
for i in range(10):
    if cnt[i] == 1:
        print(i, end=" ")

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!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS