Highest Frequency


the code is not passing only one test case.
What is the error?

@Sejalrathi,
Input:
5
1
2
2
3
3
Correct answer : 2
Your answer: 3
Hint: Use hashmap. If hashmap contains the key, value will be incremented else put the value of key as 1.