9 line Python3 solution. Beats most solutions 👌
Approach\nWe will divide the problem in two lists. One for letter logs and another for digits. By using .split(maxsplit=1) we obtain [id, words]. We will use th
# Approach\nWe will divide the problem in two lists. One for letter logs and another for digits. By using ```.split(maxsplit=1)``` we obtain ```[id, words]```. We will use this to determine if the log is digit or letter, and also to sort the letter logs (first by words and if tie by id). \n\n# Complexity\n- Time complexity: Is **O(m\xB7logm)**, being m the number of letter logs\n\n- Space complexity: **O(n)**\n\n# Code\n```\nclass Solution:\n    def reorderLogFiles(self, logs: List[str]) -> List[str]:\n        digit_logs, letter_logs = [], []\n        \n        for log in logs:\n            id, words = log.split(maxsplit=1)\n            \n            if words[0].isnumeric():\n                digit_logs += [log]    \n            else:\n                letter_logs += [log]\n\n        letter_logs.sort(key=lambda log: (log.split(maxsplit=1)[1], log.split(maxsplit=1)[0]))\n\n        return letter_logs + digit_logs        \n```\n\nPLEASE UPVOTE IF YOU LIKE IT!!
['Python3']