본문으로 바로가기
import re
def solution(files):
    answer = []
    filelist = list()
    for idx, file in enumerate(files):
        numberloc = re.search("[0-9]+", file).span()
        head = file[:numberloc[0]]
        number = int(file[numberloc[0]:numberloc[1]])
        tail = file[numberloc[1]:]
        filelist.append([idx, head.lower(), number])
    filelist.sort(key = lambda k : (k[1], k[2]), reverse = False)
    answer = [files[_[0]] for _ in filelist]
        
    return answer