i am not able to get all the test cases correct. help we with my code
Highest frequency
@ankit152
Consider a case:
4
1
2
1
2
Expected Output:
1
Your Output
2
When frequency of multiple numbers are same then you are supposed to print the smallest among those.
So instead of using unordered map, simply use a map.