[Python 3] Custom sort ||  beats 99,9% || 37ms 🥷🏼
python3 []\nclass Solution:\n    def reorderLogFiles(self, logs: List[str]) -> List[str]:\n        def customSort(log):\n            idx = log.index(\' \') + 1\
```python3 []\nclass Solution:\n    def reorderLogFiles(self, logs: List[str]) -> List[str]:\n        def customSort(log):\n            idx = log.index(\' \') + 1\n            if log[idx].isalpha():\n                return (0, log[idx:], log[:idx])\n            return (1,)\n\n        return sorted(logs, key=customSort)\n```\n```python3 []\nclass Solution:\n    def reorderLogFiles(self, logs: List[str]) -> List[str]:\n        def customSort(s):\n            idx, log = s.split(\' \', 1)\n            if log[0].isalpha(): return (0, log, idx)\n            return (1,)\n\n        return sorted(logs, key=customSort)\n```\n![Screenshot 2023-08-01 at 14.00.56.png](https://assets.leetcode.com/users/images/19ea91ea-cf93-4368-a959-efc24e18321a_1690887724.3314908.png)\n
['String', 'Sorting', 'Python', 'Python3']