Editorial for Mock CCC '18 Contest 5 J2 - Smallest Mode
Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.
Submitting an official solution before solving the problem yourself is a bannable offence.
This problem is asking to compute the mode of a list of numbers - if there is more than one mode, return the smallest one.
There are multiple ways to determine if a number is a mode - due to the low bounds, one can manually count how many 1's there are, and compare against the number of 2's. That can be compared against the number of 3's, and this can be continued all the way to 10.
Comments