While this works, you loop through the complete collection of values 3 times. First while reading it in the scanner. Second while scanning for the max value in the collection after reading it in and third to count the number of times it was found.

In some test cases, the highest (max) element is the one most common - like in example case, where 3 is the most common element. It also passes some test cases.
The correct solution is the one with Counter.

My solution finishd in about half the time, I would assume because I'm looping through it only once. Depends on whether you want a quick and dirty solution (mine) or one that's more Pythonic (in your case, can be more difficult to read):

this was my code.
to get max_height, i use the loop twice. so it didn't work.
but like you said, its working with single loop! thanks
and it is so amazing that you used single looop... never imagined it