#include "soln.hpp" vector> Solution::groupAnagrams(vector &strs) { unordered_map> str_map; for (string s : strs) { string t = s; sort(t.begin(), t.end()); str_map[t].push_back(s); } vector> anag; for (auto it : str_map) { anag.push_back(it.second); } return anag; }