Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let num = +gets();
- let array = [];
- let repeatPlace = [];
- for (i = 0; i <= 10; i++) {
- repeatPlace.push(0);
- }
- let maxRepNum = 0;
- let maxRepPlace = 0;
- for (i = 0; i < num; i++) {
- currentNum = +gets();
- repeatPlace[currentNum]++;
- currentPlace = repeatPlace[currentNum];
- if (currentPlace > maxRepPlace) {
- maxRepNum = currentNum;
- maxRepPlace = currentPlace;
- }
- }
- print(maxRepNum);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement