Simple java solution
\n    public List> groupAnagrams(String[] strs) {\n\t\tList> res = new ArrayList<>();\n        HashMap> map = new HashMap<>();\n        \n        Arrays.sort(st
\n    public List<List<String>> groupAnagrams(String[] strs) {\n\t\tList<List<String>> res = new ArrayList<>();\n        HashMap<String, List<String>> map = new HashMap<>();\n        \n        Arrays.sort(strs);\n        for (int i = 0; i < strs.length; i++) {\n        \tString temp = strs[i];\n        \tchar[] ch = temp.toCharArray();\n        \tArrays.sort(ch);\n        \tif (map.containsKey(String.valueOf(ch))) {\n        \t\tmap.get(String.valueOf(ch)).add(strs[i]);\n        \t} else {\n        \t\tList<String> each = new ArrayList<>();\n        \t\teach.add(strs[i]);\n        \t\tmap.put(String.valueOf(ch), each);\n        \t}\n        }\n        for (List<String> item: map.values()) {\n        \tres.add(item);\n        }\n        return res;\n    }
['Java']