Javascript, sort()
\nvar reorderLogFiles = function(logs) {\n    \n    function getLog(str){ // get after-identifier part of log\n        return str.slice(str.indexOf(\' \')+1);\n
```\nvar reorderLogFiles = function(logs) {\n    \n    function getLog(str){ // get after-identifier part of log\n        return str.slice(str.indexOf(\' \')+1);\n    }    \n    \n    function isDigitalStr(str){  // the condition is that either ALL str[i] are digits or they ALL are symbols\n                                // so we may check str[0] only\n        return (str[0] >= \'0\' && str[0] <= \'9\') ? true : false;\n    }\n    \n    function compare(a, b){  // main comparing function for 2 strings, if they\'re equal then compares identifiers\n        let res = getLog(a).localeCompare(getLog(b));\n        return (res == 0) ? a.slice(0, a.indexOf(\' \')).localeCompare(b.slice(0, b.indexOf(\' \'))) : res;\n    }\n    \n    let resLogs = []; // the resulting array: all digital logs will go into it befor symbol logs\n    let symbolLogs = []; // the array for sorting symbol logs\n\n    for(let i = 0; i < logs.length; i++){\n        if(isDigitalStr(getLog(logs[i])))\n            resLogs.push(logs[i]);\n        else\n            symbolLogs.push(logs[i]);\n    }\n\n    return [...symbolLogs.sort(compare), ...resLogs];\n    \n};\n```
[]