0

I am making a program that keeps a list of users and Integer values in a HashMap. I need to loop through the HashMap, and get the three highest values. I also need to get corresponding key of those three values.

For example - HashMap with values:

User1: 13

User2: 325

User3: 1

User4: 456

User5: 666

Would give me:

User5

User4

User2

(In that order)

Sabir Khan
  • 9,218
  • 6
  • 38
  • 87
Benjamin Owen
  • 579
  • 2
  • 9
  • 28

0 Answers0