JAVA_LeetCode 274_H_Index 풀이 class Solution { public int hIndex(int[] citations) { // 오름차순 정렬해서 논문 인용 횟수와 현 수를 비교해서, h 이상 인용된 논문이 h편 이상인 경우를 찾는다. Arrays.sort(citations); int len = citations.length; for(int h = len; h > 0; h--) { if(citations[len - h] >= h) return h; } return 0; } } 배열 정렬, 현 수와 인덱스에 해당하는 값 체크 * 출처 https://leetcode.com/problems/h-index/?
envType=problem-list-v2&envId=2fir0h51...
JAVA_LeetCode 274_H_Index에 대한 요약내용입니다.
자세한 내용은 아래에 원문링크를 확인해주시기 바랍니다.