A clean c++ solution with unordered_map
\tvector> groupAnagrams(vector& strs) {\n\t\tunordered_map> count;\n\t\tint i = 0;\n\t\tfor (auto s : strs)\n\t\t{\n\t\t\tsort(s.begin(), s.end());\n\t\t\tcount
\tvector<vector<string>> groupAnagrams(vector<string>& strs) {\n\t\tunordered_map<string, vector<string>> count;\n\t\tint i = 0;\n\t\tfor (auto s : strs)\n\t\t{\n\t\t\tsort(s.begin(), s.end());\n\t\t\tcount[s].push_back(strs[i++]);\n\t\t}\n\t\tvector<vector<string>> res;\n\t\tfor (auto n : count){\n\t\t\tsort(n.second.begin(), n.second.end());\n\t\t\tres.push_back(n.second);\n\t\t}\n\t\treturn res;\n\t}
[]