So here\'s the code I\'ve got so far...
import java.util.Scanner;
class count{
public static void main(String args[]){
Scanner s=new Scanner(Syst
Tips: When you are building the HashMap, at the same time, you can store the maximum value and corresponding character. Still O(n) but the code would be cleaner.