python3 using heap(faster than 99.98%)
\'\'\'\n  class Solution:\n\t\n        def reorderLogFiles(self, logs: List[str]) -> List[str]:\n\t\t\n            let = []\n            dig = []\n            h
\'\'\'\n  class Solution:\n\t\n        def reorderLogFiles(self, logs: List[str]) -> List[str]:\n\t\t\n            let = []\n            dig = []\n            heap = []\n\t\t\t\n            for log in logs:\n                res = log.split(\' \')\n                if res[1][0].isdigit():\n                    dig.append(log)\n                    continue\n                cont = \' \'.join(res[1:])\n                iden = res[0]\n                heapq.heappush(heap, (cont, iden))  # we will heapify by lexicographical order of content then identifier\n\t\t\t\t\n            for _ in range(len(heap)):\n                cont, iden = heapq.heappop(heap)  # heappop gives the lexicographically smallest element\n                let.append(iden + \' \' + cont)\n        \n            return let + dig\n\'\'\'
['Heap (Priority Queue)', 'Python', 'Python3']