public int solution(int[] citations) {
Arrays.sort(citations);
int n = citations.length;
for (int i = 0; i < n; i++) {
int h = n - i;
int minCitations = Math.min(citations[i], h);
if (minCitations >= h) {
return h;
}
}
return 0;
}
출처:https://school.programmers.co.kr/learn/courses/30/lessons/42747