C++ easy solution
\n    bool compare(string str1, string str2) {\n        int pos1 = str1.find(\' \');\n        int pos2 = str2.find(\' \');\n        string s1 = str1.substr(pos1
```\n    bool compare(string str1, string str2) {\n        int pos1 = str1.find(\' \');\n        int pos2 = str2.find(\' \');\n        string s1 = str1.substr(pos1+1);\n        string s2 = str2.substr(pos2+1);\n        if(s1 == s2) {\n            if(str1.compare(str2)<0) return true;\n            return false;\n        }\n        if(s1.compare(s2)<0) return true;\n        return false;\n    }\n\nclass Solution {\npublic:\n    \n    vector<string> reorderLogFiles(vector<string>& logs) {\n        vector<string> let;\n        vector<string> dig;\n        vector<string> ans;\n        for(int i=0; i<logs.size(); i++) {\n            int pos = logs[i].find(\' \');\n            if(logs[i][pos+1]>=\'0\' && logs[i][pos+1]<=\'9\') {\n                dig.emplace_back(logs[i]);\n            } else {\n                let.emplace_back(logs[i]);\n            }\n        }\n        \n        sort(let.begin(), let.end(), compare);\n        ans.insert(ans.end(), let.begin(),let.end());\n        ans.insert(ans.end(), dig.begin(),dig.end());\n        return ans;\n        \n    }\n};\n```
['String', 'C', 'Sorting']