코딩테스트 고득점 Kit - 정렬 3 (Level 2)

 

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)