Reorder Data in Log Files : leetcode solution in python

class Solution:
    def reorderLogFiles(self, logs: List[str]) -> List[str]:
            dig_list = []
            letter_list = []
            for i in range(len(logs)):
                each_ele_lst = logs[i].split()
                if each_ele_lst[1].isdigit():
            letter_list.sort(key = (lambda x: (x.split()[1:], x.split()[0])))
            return letter_list+dig_list
        except Exception as e:

1 thought on “Reorder Data in Log Files : leetcode solution in python”

Leave a Comment

Your email address will not be published. Required fields are marked *

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.

Powered By
Best Wordpress Adblock Detecting Plugin | CHP Adblock