Hashing question highest frequency question

https://ide.codingblocks.com/s/67179
one test case is wrong

@meg.2198 your code is not working for
this test case 4
1
2
1
2
expected output is 1
your output is 2
and question is concerned about hash map but in your program you didn’t take any hash map try to implement with hash map

Thakyou! It’s done.I got my all test cases passed.