프로그래머스 연습문제 - H-Index (level2)

j_wisdom_h·2022년 11월 30일
0

CodingTest

목록 보기
22/58
post-thumbnail

프로그래머스 연습문제 - H-Index (level2)


문제설명


제한사항 & 입출력 예


My Solution

def solution(citations):
    for i in range(max(citations)):
        answer = len(list(filter(lambda x: x >= i, citations)))
        if i >= answer:
            return answer

15분도 안 걸리고 성공 ~~!!


다른 솔루션

def solution(citations):
    citations = sorted(citations)
    l = len(citations)
    for i in range(l):
        if citations[i] >= l-i:
            return l-i
    return 0
profile
뚜잇뚜잇 FE개발자

0개의 댓글