본문 바로가기
알고리즘/프로그래머스

[파이썬][프로그래머스] 정렬 H-Index

by SBOX Learning by doing 2022. 11. 23.
반응형
def solution(citations):
    answer = 0

    for i in range(max(citations)+1):
        count = 0
        for j in range(len(citations)):
            if i <= citations[j]:
                count += 1
        if count >= i:
            answer = i 
    return answer
반응형

댓글