https://programmers.co.kr/learn/courses/30/lessons/42747
Code
1
2
3
4
5
6
def solution(citations):
sorted_citations = sorted(citations, reverse=True)
for i in range(len(sorted_citations)):
if sorted_citations[i] <= i:
return i
return len(sorted_citations)
Complexity
$O(nlogn)$
- $n$ = len(citations)
PREVIOUSEtc