You are viewing a single comment's thread. Return to all comments →
Count the element with maximum frequency and all other elements must be removed apart from that. from collections import Counter n=int(raw_input())
array=Counter(map(int,raw_input().split())) a=[] a=Counter(array).values() print(n-max(a))
Seems like cookies are disabled on this browser, please enable them to open this website
Equalize the Array
You are viewing a single comment's thread. Return to all comments →
Count the element with maximum frequency and all other elements must be removed apart from that. from collections import Counter n=int(raw_input())
array=Counter(map(int,raw_input().split())) a=[] a=Counter(array).values() print(n-max(a))