Здравейте, колеги. От един ден се мъча със задача Repeating Numbers от Mock exam 3.
Repeating Numbers
Write a program that accepts an array of integers and returns the one that occurs the most times. If there are two numbers that occur the same amount of times, return the smaller of the two.
Input
- Read from the standard input;
- The number N is on the first line;
- An integer between 1 and 10 is written on each of the next N lines;
- The input data will always be valid and in the format described. There is no need to check it explicitly;
Output
- Print to the standard output;
- On the only output line you must print the number that occurs the most;
Constraints
- The number N is a positive integer between 1 and 100 000, inclusive;
- The list of numbers consists of positive integers between 1 and 10, inclusive;
Input
4 1 3 3 7
Output
3
В judge ми дава 20/100. Ще се радвам някой ако може да ми даде някакви насоки с какви други инпути да пробвам и да видя къде се чупи.
И също така на изпита ако ми се случи нещо подобно, как да процедирам?