c++ overload comparator
\nclass Solution {\n    struct Compare {\n        bool operator()(const string& s1, const string& s2) {\n            string ss1 = s1.substr(s1.find(\' \')+1),\n
```\nclass Solution {\n    struct Compare {\n        bool operator()(const string& s1, const string& s2) {\n            string ss1 = s1.substr(s1.find(\' \')+1),\n                   ss2 = s2.substr(s2.find(\' \')+1);\n            if(ss1 == ss2) return s1 < s2;\n            return ss1 < ss2;\n        }\n    };\npublic:\n    vector<string> reorderLogFiles(vector<string>& logs) {\n        vector<string> llogs, dlogs;\n        for(string log : logs) {\n            string cur = log.substr(log.find(\' \')+1);\n            if(\'a\' <= cur[0] && cur[0] <= \'z\') llogs.push_back(log);\n            else dlogs.push_back(log);\n        }\n        sort(llogs.begin(), llogs.end(), Compare());\n        llogs.insert(llogs.end(), dlogs.begin(), dlogs.end());\n        return llogs;\n    }\n};\n```
[]