Okay. Any idea where my code is failing?
1
8
1 1 2 4 4 4 4 4
try this once please
o/p should be 1 but its giving 5. Thanks I got the issue.
np 
bruh length of vector b is n not 10
My code is still giving wrong answers… ![]()
Let me know if you find any mistake?
https://www.codechef.com/viewsolution/37291130
Thanks
u want me to find ur mistake or tell a solution bruh?
from collections import Counter
def find_modes():
case = int(input())
while(case!=0):
numval = (map(int, input()))
val = list(map(int, input().split()))
count = Counter(val)
freq = list(count.values())
c = Counter(freq)
l = c.most_common()
#print(count, end="\n")
#print("most common: ", l)
mode = l[0][0]
for i in range(0,(len(l)-1)):
if(l[i][1] != l[i+1][1]):
mode = l[i][0]
break
else:
if(l[i][1]>l[i+1][1]):
mode = l[i][0]
#print(“mode”, mode)
print(mode)
case = case - 1
return 0
find_modes()
nice code
Thanks 
Thanks. It did help.
Thank you as well
can you please explain your code
i dont think theres a need to sort the list man…
https://www.codechef.com/viewsolution/37228724
refer my solution if u like…
thanks bro
but I have initially done it with vector it showing runtime error can you explain reason behind that??
all you gotta do is calculate frequency of frequencies and then return the min element with max value
yes, follow the instruction given in question 1->count the freq of Ai
2->count the freq of (freq of Ai)
3->print the required o/p
I am storing the freq in map
i might be able to help you if i see your code