Python3 5 lines Easy to understand with comments
\nclass Solution:\n    def reorderLogFiles(self, logs: List[str]) -> List[str]:\n        #split the list into digit and letter\n        digit = [log for log in 
```\nclass Solution:\n    def reorderLogFiles(self, logs: List[str]) -> List[str]:\n        #split the list into digit and letter\n        digit = [log for log in logs if log.split()[1].isdigit() ]\n        letter = [log for log in logs if log.split()[1].isalpha() ]\n        \n        #sort the letter list by its contents, if contents are the same, sort it by its identifier\n        letter.sort(key = lambda x: (x.split()[1:],x.split()[0]))\n        \n        return letter + digit \n```
['Sorting', 'Python']