[leetcode-937] Reorder_Data_in_LogFile
ยท
๐Ÿข One step
LeetCode-937 Reorder_Data_in_LogFile : reorder log files ์ฒซ๋ฒˆ์งธ ๋ฌธ์ž ์‹๋ณ„์ž ex) "dig2 a","dig1 b"-> "a","b"Myanswerclass Solution: def reorderLogFiles(self, logs: List[str]) -> List[str]: let = [] digit = [] for i in logs: if i.split()[1].isdigit()==False: let.append(i) else: digit.append(i) let.sort(key = lambda x: (x.split()[1:], x.split()[0])) #digit.sort(key = lambda x: x.split()[1:],reverse=True) r..
๋‹คํ–ˆ๋‹ค
'Reorder_Data_in_LogFile' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก