My issue
t=int(input())
for _ in range(t):
n=int(input())
l=list(map(int,input().split()))
new_lst =[]
for i in l:
new_lst.append(l.count(i))
max_val = max(new_lst)
print(n - max_val)
My code
# cook your dish here
t=int(input())
for _ in range(t):
n=int(input())
l=list(map(int,input().split()))
new_lst =[]
for i in l:
new_lst.append(l.count(i))
max_val = max(new_lst)
print(n - max_val)
Learning course: Arrays, Strings & Sorting
Problem Link: Equal Elements Practice Problem in - CodeChef
when I run it is running successfully but when I submit this page showing time out. if any one can help me on this problem.