No Fancy STL functions | Pure Logic | CPP
```\nbool comp(string &a, string &b){\n    int p1 = a.find(\' \');\n    int p2 = b.find(\' \');\n    string s1 = a.substr(p1+1);\n    string s2 = b.substr(p2+1)
```\nbool comp(string &a, string &b){\n    int p1 = a.find(\' \');\n    int p2 = b.find(\' \');\n    string s1 = a.substr(p1+1);\n    string s2 = b.substr(p2+1);\n    if(s1==s2) return  a < b;\n    return s1 < s2;\n}\nclass Solution {\npublic:\n    vector<string> reorderLogFiles(vector<string>& logs) {\n        vector<string> letter;\n        vector<string> digits;\n        vector<string> res;\n        for (int i = 0; i < logs.size(); i++){\n            int pos = logs[i].find(\' \');\n            if (logs[i][pos+1] >= \'0\' and logs[i][pos+1] <=\'9\'){\n                digits.push_back(logs[i]);\n            }\n            else{\n                letter.push_back(logs[i]);\n            }\n        }\n        sort(letter.begin(), letter.end(), comp);\n        res.insert(res.end(),letter.begin(),letter.end());\n        res.insert(res.end(), digits.begin(), digits.end());\n        return res;\n    }\n};
['C', 'C++']