L1 : 명예의 전당(1) Python

jhyunn·2023년 1월 23일
0

Programmers

목록 보기
56/69

L1 : 명예의 전당(1) Python

https://school.programmers.co.kr/learn/courses/30/lessons/138477

def solution(k, score):
    answer = []
    hof = []
    for i in score:
        hof.append(i)
        hof.sort(reverse=True)
        if len(hof) > k:
            hof.pop()
        answer.append(hof[-1])
    return answer
profile
https://github.com/Sungjeonghyun

0개의 댓글