# https://programmers.co.kr/learn/courses/30/lessons/17686

def solution(files):
    arr = []
    for file in files:
        head, number = "", ""
        flag = True
        for f in file:
            if f.isdigit():
                number += f
                flag = False
            elif flag:
                head += f
            else:
                break
        arr.append([file, head, number])
        arr.sort(key=lambda x: (x[1].lower(), int(x[2])))
    return [i[0] for i in arr]

a38b9b4b41fbd8716ee94a449c766b7ab694ef7e
<mask token>

def solution(files):
    arr = []
    for file in files:
        head, number = '', ''
        flag = True
        for f in file:
            if f.isdigit():
                number += f
                flag = False
            elif flag:
                head += f
            else:
                break
        arr.append([file, head, number])
        arr.sort(key=lambda x: (x[1].lower(), int(x[2])))
    return [i[0] for i in arr]

# https://programmers.co.kr/learn/courses/30/lessons/17686

def solution(files):
    arr = []
    for file in files:
        head, number = "", ""
        flag = True
        for f in file:
            if f.isdigit():
                number += f
                flag = False
            elif flag:
                head += f
            else:
                break
        arr.append([file, head, number])
        arr.sort(key=lambda x: (x[1].lower(), int(x[2])))
    return [i[0] for i in arr]
