задача Most Frequent Numbers C#
Здравейте,
Може ли малко помощ.
judge-а ми дава 70/100 и не мога да си открия грешката.
Благодаря
моето решение:
https://pastebin.com/XGhdaVwz
задача:
Most Frequent Number( judge: https://judge.softuni.bg/Contests/Practice/Index/207#7)
Write a program that finds the most frequent number in a given sequence of numbers.
- Numbers will be in the range [0…
- In case of multiple numbers with the same maximal frequency, print the leftmost of them.
Examples
Input |
Output |
Output |
4 1 1 4 2 3 4 4 1 2 4 9 3 |
4 |
The number 4 is the most frequent (occurs 5 times) |
2 2 2 2 1 2 2 2 |
2 |
The number 2 is the most frequent (occurs 7 times) |
7 7 7 0 2 2 2 0 10 10 10 |
7 |
The numbers 2, 7 and 10 have the same maximal frequence (each occurs 3 times). The leftmost of them is 7. |
Много благодаря!!!
Грешката беше доста тъпа :)