[프로그래머스] H-Index
2020. 3. 28. 14:19ㆍ프로그래머스/LEVEL 2
import java.util.*;
class Solution {
public int solution(int[] citations) {
int answer = 0;
Arrays.sort(citations);
for(int i=citations.length-1; i>=0; i--){
int minnum = (int)Math.min(citations[i],citations.length-i);
if(answer<minnum){
answer =minnum;
}
}
return answer;
}
}
문제 해석이 헷갈렸다.
'프로그래머스 > LEVEL 2' 카테고리의 다른 글
| [프로그래머스] 최댓값과 최솟값 (0) | 2020.03.28 |
|---|---|
| [프로그래머스] 더 맵게 (0) | 2020.03.28 |
| [프로그래머스] 프린터 (0) | 2020.03.27 |
| [프로그래머스] 피보나치 수 (0) | 2020.03.27 |
| [프로그래머스] 가장 큰 수 만들기 (0) | 2020.03.25 |