//*******************************************************************
// NOTE: please read the 'More Info' tab to the right for shortcuts.
//*******************************************************************

import java.lang.Math; // headers MUST be above the first class

import java.util.HashMap;
public class HelloWorld{
public static void main(String []args){
   String inp = "practice makes perfect. get perfect by practice. just practice!";
   
   HashMap<String, Integer> result = new HashMap<String, Integer>();
   //Regex
  
  
  
   inp.replace("!", "");
   inp.replace(".", "");
   
   //args = practice makes perfect get perfect by practice just practice"
   
   String[] array = inp.split(" "); //9 strings separately
   
   for(int i=0;i<array.length;i++){//------------------------->O(n)
      if(result.containsKey(array[i])){
         int count = result.get(array[i]);
         result.put(array[i], ++count);
      }
      else{
         result.put(array[i], 1);
      }
   }
   
   TreeMap<Integer, ArrayList<String>> hmapNew = new TreeMap<>(Collections.reverseOrder());
   for(EntrySet<String, Integer> es : result.getEntrySet()){//------------->O(n)
      if(hmapNew.containsKey(es.getValue())){
         ArrayList<String> al = hmapNew.get(es.getValue());
         al.add(es.getKey());
         hmapNew.put(es.getValue(), al);
      }
      else{
         ArrayList<String> al = new ArrayList<String>();//------------>O(n)
         al.add(es.getKey());
         hmapNew.put(es.getValue(), al);
      }
   }
   
   for(EntrySet<Integer, ArrayList<String>> finalES : hmapNew.getEntrySet()){//--->O(n)
      for(int x=0;x<finalES.getValue().length;x++){//--->O(k)
         System.out.println(finalES.Value.get(x)+":"+es.getKey());
      }      
   }
}
   
//O(n.k) n->strings k->average number of strings in the arraylist
}

@@ -1,214 +1,4 @@
-//*******************************************************************%0A// NOTE: please read the 'More Info' tab to the right for shortcuts.%0A//*******************************************************************%0A%0A
 impo
@@ -75,23 +75,17 @@
 va.util.
-HashMap
+*
 ;%0Apublic
@@ -1513,18 +1513,23 @@
 (x)+%22:%22+
-es
+finalES
 .getKey(

Update WordCount.java