728x90
반응형
문제 출처: https://school.programmers.co.kr/learn/courses/30/lessons/42747
풀이:
def solution(citations):
for idx , people in enumerate(sorted(citations)):
if people >= len(citations) - idx :
return len(citations) - idx
return 0
print(solution([3, 0, 6, 1, 5]))
citations.sort(reverse=True)
answer = max(map(min, enumerate(citations, start=1)))
return answer
enumerate 에 start 넣을수 있는거 방금 앎
반응형
댓글