LoginSignup
Rick Harrison

Rick Harrison

pritamultimate007@gmail.com

Dropped 24 days ago,

Last activity 16 days ago

1 answers

To solve this, we convert the list into a set (to get unique values), and then count how many of those values appear more than once in the original list.


nums = list(map(int, input().split()))

print(len([x for x in set(nums) if nums.count(x) > 1]))

Input: 1 2 3 2 4 5 3 1

Output: 3

Question
1 of 1