문제 링크
풀이
- len(citations)-index : h편 이상 인용된 논문의 수
def solution(citations):
# 정렬
citations.sort()
for index, h in enumerate(citations):
# h번 이상 인용된 논문이 h편 이상
if h >= len(citations) - index :
return len(citations) - index
return 0
'개발 > algorithm' 카테고리의 다른 글
[프로그래머스][level3] [1차] 추석 트래픽 - python (0) | 2022.03.29 |
---|---|
[프로그래머스][level2] 전력망을 둘로 나누기 - python (0) | 2022.03.25 |
[프로그래머스][level2] 행렬 테두리 회전하기 - python (0) | 2022.03.25 |
[백준 2263번] 트리의 순회 - python (0) | 2022.03.18 |
[백준 11779번] 최소비용 구하기 2 - python (0) | 2022.03.18 |