Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- 2023
- 멀티스레딩
- SQL
- FastAPI
- Stored Procedure
- 프로그래머스
- 문제풀이
- 퓨처셀프
- 혼자 공부하는 SQL
- Programmers
- PCA
- 다시 왔다!
- 선형대수
- Django
- CS
- mysql
- Til
- 덴드로그램
- 컴퓨터 과학이 여는 세계
- 한 권으로 읽는 컴퓨터 구조와 프로그래밍
- WIL
- 1463
- stored function
- 미래혁신대전
- Recommender system
- JP Study
- 백준
- MVT
- 엘런 튜링
- computer science
Archives
- Today
- Total
Growth Hoon
20231027_TIL_프로그래머스 본문
def solution(k, scores):
answer = []
hof = []
for score in scores:
if len(hof) >= k:
if min(hof) > score: # 명예의 전당에서 최소값이 더 큰 경우
answer.append(min(hof))
else: # 명예의 전당에서 최소값이 더 작은 경우
min_index = hof.index(min(hof))
del hof[min_index]
hof.append(score)
answer.append(min(hof))
else:
hof.append(score)
answer.append(min(hof))
return answer