HELP IN MODEFREQ (PYTHON)

MY SOLUTION-https://www.codechef.com/viewsolution/37224521
PROBLEM-https://www.codechef.com/LTIME87B/problems/MODEFREQ/

GETTING WA CAN SOMEONE TELL WHY?

your code gives wa when the frequencies of number will match
eg:
6
1 1 4 4 2 3
your code can give ans 2
but you have to get 1 as output