Engaged employer
Write a Java program to read 10 records in the format roll-score, store only the highest score for each roll number using a HashMap, and print the records sorted in descending order of score.
Anonymous
I used Java HashMap to store the highest score for each roll number. Then I converted the HashMap entries into an ArrayList, sorted them in descending order using Collections.sort() with a custom comparator, and printed the final output.
Check out your Company Bowl for anonymous work chats.