Can anybody help how to get the the maximum value in a map along with its key. For example map below:
Map(s -> 3, h -> 2, M -> 1, q-> 4)
I should get the key value (q -> 4) as the 4 is the highest.
I tried the max method,keys and values iterator. But none of the return both key and value.