Beat 90.2%, 18ms, O(n), non-sort solutions with hashMap
we know each word can be represented by their counter array which counts every letter's occurrences, so we can use this counter array as an ID for the anagram, 
**we know each word can be represented by their counter array which counts every letter's occurrences, so we can use this counter array as an ID for the anagram, more specifically, use this counter array's hash code as the key, the anagram list as the value, we can distribute all the words into corresponding anagram group in O(n) time complexity.**\n\n```\npublic int getID(String s){\n        int[] counter   =   new int[26];\n        for(char ch : s.toCharArray()){\n            counter[ch - 'a']++;\n        }\n        \n        return Arrays.hashCode(counter);    //use the counter array's hash code as this anagram's ID\n    }\n    \n    //solution takes 18ms\n    public List<List<String>> groupAnagrams(String[] strs) {\n        List<List<String>> groups   =   new ArrayList<>();\n        Map<Integer, List<String>> anagramMap   =   new HashMap<>();\n        \n        for(String word : strs){\n            int id   =   getID(word);   //unique for each anagram\n            List<String> group  =   anagramMap.get(id);\n            \n            if(null == group){\n                group  =   new ArrayList();\n                anagramMap.put(id, group);\n           \n            }\n            \n            group.add(word);\n        }\n        \n        groups.addAll(anagramMap.values());\n        \n        return groups;\n    }\n```\n\n***If u think it make sense, plz vote for me, thx : )***\n\nbtw, my code was also hosted on github:) https://github.com/Emilio66/leetcode/blob/master/P49_GroupAnagrams.java
[]