Solution :
def solution(citations):
citations.sort(reverse=True) # 인용수 내림차순 정렬
for idx, citation in enumerate(citations):
# print(citation, idx)
if citation <= idx: # idx번 이상 인용된 논문이 idx편 이상.
return idx
return len(citations) # for문 다 돌아도 안된다면, 최대 개수가 h_index.
Skills :
-
'코딩테스트 > 프로그래머스' 카테고리의 다른 글
[프로그래머스] LV2 카펫 | 파이썬 (0) | 2025.05.12 |
---|---|
[프로그래머스] LV2 소수 찾기 | 파이썬 (0) | 2025.05.12 |
[프로그래머스] LV2 가장큰수 | 파이썬 (0) | 2025.05.12 |
[프로그래머스] LV2 더 맵게 | 파이썬 (0) | 2025.05.07 |
[프로그래머스] LV1 데이터분석 | 파이썬 (0) | 2025.05.07 |