@@ -0,0 +1,996 @@
+package com.sunny.grokkingalgorithms.gfg.ntx;%0A%0A%0Aimport java.util.Arrays;%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A/**%0A * Created by sundas on 4/22/2018.%0A */%0Apublic class FindCountOfAnagrams %7B%0A%0A  /*%0A  Given an array of strings , find the count of anagrams%0A   */%0A%0A  /**%0A   *%0A   * @param input%0A   */%0A  public static void printAnagramsWithCount(String%5B%5D input)%7B%0A    Map%3CString,Integer%3E countTable = new HashMap%3C%3E();%0A    for(int i = 0 ; i %3C input.length ; i++)%7B%0A      String str = input%5Bi%5D;%0A      char%5B%5D rep = str.toCharArray();%0A      Arrays.sort(rep);%0A      String key = String.valueOf(rep);%0A      if(countTable.containsKey(key))%7B%0A        countTable.put(key,countTable.get(key)+1);%0A      %7D%0A      else%7B%0A        countTable.put(key,1);%0A      %7D%0A    %7D%0A    System.out.println(countTable);%0A  %7D%0A%0A  /**%0A   *%0A   * @param args%0A   */%0A  public static void main(String%5B%5D args) %7B%0A    String%5B%5D input = new String%5B%5D%7B%22abba%22,%22acba%22,%22bbaa%22,%22ttres%22,%22baca%22,%22yiuryweuryw%22%7D;%0A    printAnagramsWithCount(input);%0A  %7D%0A%7D%0A

Find anagram count from ian array of string inputs nsquare log n