摘要:
把每个string按字母排个序,然后就能很方便的进行string的两两比较class Solution { private: vector<string> ret; map<string, vector<string> > m; public: vector<string> anagrams(vector<string> &strs) { ret.clear(); m.clear(); for(int i = 0; i < strs.size(); i++) { string sor... 阅读全文