Здравейте, имам проблем със задачата Repeating Numbers от примерния изпит.
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
Получавам 50/100 и грешка Time Limit Exceeded при положение, че локално всичко работи както трябва. Ще се радвам, ако някой може да ми помогне да разбера откъде идва проблема! https://pastebin.com/7Y1bC4JP
EDIT: в Джъдж съм подал да се логва само числото, без броя на повторениея.