public static void printResult(Map<String,Integer> result){
        if(result.size()==0){
            System.out.println("No duplicates.");
            return;
        }
        int total=0,times=0;
        for(Map.Entry<String,Integer> e : result.entrySet()){
            times = e.getValue();
            if(times>1){
                total+=1;
                System.out.println(e.getKey()+" "+times);
            }
        }
        if(total==0){
            System.out.println("No duplicates.");
            return;
        }
    }