[JAVA] HashMap solution and no sorting required
\nclass Solution {\n    public List<List<String>> groupAnagrams(String[] strs) {\n        Map<String, List<String>> map = new HashMap();\n        for (String s 
```\nclass Solution {\n    public List<List<String>> groupAnagrams(String[] strs) {\n        Map<String, List<String>> map = new HashMap();\n        for (String s : strs) {\n            int[] m = new int[26];\n            for (char c : s.toCharArray()) m[c-\'a\']++;\n            String key = Arrays.toString(m);\n            map.putIfAbsent(key, new ArrayList());\n            map.get(key).add(s);\n        }\n        return new ArrayList(map.values());\n    }\n}\n```
[]