Java solution using HashMap || easy to understand
\nclass Solution {\n    public List<List<String>> groupAnagrams(String[] str) {\n        int n=str.length;\n        HashMap<String,ArrayList<String>> hm=new Has
```\nclass Solution {\n    public List<List<String>> groupAnagrams(String[] str) {\n        int n=str.length;\n        HashMap<String,ArrayList<String>> hm=new HashMap<>();\n        List<List<String>> list=new ArrayList<>();\n        \n        for(int i=0;i<n;i++){\n            char [] ch=str[i].toCharArray();\n            Arrays.sort(ch);\n            String temp=new String(ch);\n            if(hm.containsKey(temp)){\n                hm.get(temp).add(str[i]);\n            }\n            else{\n                ArrayList<String> t=new ArrayList<>();\n                t.add(str[i]);\n                hm.put(temp,t);\n            }\n        }\n        \n        for(String key:hm.keySet()){\n            list.add(hm.get(key));\n        }\n        \n        return list;\n    }\n}\n```
['Array', 'String', 'Sorting', 'Java']