I gave this thinking the number of elements and the actual elements would be on different lines
numval = (map(int, input()))
val = list(map(int, input().split()))
So does the input provided in codechef comes
5
1 2 3 1 2
or
5 1 2 3 1 2?
I gave this thinking the number of elements and the actual elements would be on different lines
numval = (map(int, input()))
val = list(map(int, input().split()))
So does the input provided in codechef comes
5
1 2 3 1 2
or
5 1 2 3 1 2?
Okay. thanks. Iāll check.
sorry my mistake i gave it in the a format that works on c++
nvm urs working my bad
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