https://school.programmers.co.kr/learn/courses/30/lessons/138477
def solution(k, score):
result = []
score_list = []
for s in score:
score_list.append(s)
score_list.sort(reverse=True)
if len(score_list) >= k:
score_list = score_list[:k]
result.append(score_list[-1])
return result
728x90
반응형
'🔻PS > Programmers' 카테고리의 다른 글
[Programmers] 프로그래머스 n진수 게임 Python (0) | 2024.05.20 |
---|---|
[Programmers] 프로그래머스 외계인 사전 Python (0) | 2024.05.19 |
[Programmers] 프로그래머스 정수 내림차순으로 배치하기 Python (0) | 2024.05.19 |
[Programmers] 프로그래머스 튜플 Python (0) | 2024.05.16 |
[Programmers] 프로그래머스 다트 게임 Python (0) | 2024.05.16 |