Sharing my very concise solution with explanation
vector<string> anagrams(vector<string> &strs) {\n        vector<string> result;\n        vector<string> sortedStrs = strs;\n        unordered_map<string, vector
    vector<string> anagrams(vector<string> &strs) {\n        vector<string> result;\n        vector<string> sortedStrs = strs;\n        unordered_map<string, vector<int>> map;\n        for(int i = 0; i < strs.size(); i++){\n            sort(sortedStrs[i].begin(), sortedStrs[i].end());\n            map[sortedStrs[i]].push_back(i);\n        }\n        for(auto it = map.begin(); it != map.end(); it++){\n            if(it->second.size() > 1){\n                for(int i = 0; i < it->second.size(); i++){\n                    result.push_back(strs[it->second[i]]);\n                }\n            }\n        }\n        return result;\n    }\n\nHere is basic idea for this problem.\n\nFirst, get a copy of "strs". Let's name this copy "sortedStrs".\n\nSecond, sort all strings in "sortedStrs".\n\nAnd we have a hash map `unordered_map<string, vector<int>> map`.\n\nEvery string in "sortedStrs" will be recorded in this hash map with its position.\n\nIn the second loop, we traverse this hash map. And find each value of which size is larger than 1. Then find the original string in "strs".\n\nDone.
['Hash Table', 'Sorting', 'C++']