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,826
  • 7
  • 45
  • 98
Benjamin Owen
  • 608
  • 2
  • 10
  • 28

0 Answers0