링크 : https://school.programmers.co.kr/learn/courses/30/lessons/42747#qna
프로그래머스
SW개발자를 위한 평가, 교육, 채용까지 Total Solution을 제공하는 개발자 성장을 위한 베이스캠프
programmers.co.kr
문제 풀이
i번째 논문 인용 횟수가 남은 논문 개수보다 클 경우 H-Index 조건 만족
import java.util.*;
class Solution {
public int solution(int[] citations) {
int answer = 0;
Arrays.sort(citations);
for(int i=0; i<citations.length; i++) {
int left = citations.length - i; // 남은 논문 개수
if(citations[i] >= left) {
return left;
}
}
return answer;
}
}'알고리즘 > 프로그래머스' 카테고리의 다른 글
| [프로그래머스] 완전범죄(Java) (1) | 2025.03.06 |
|---|---|
| [프로그래머스] 조이스틱(Java) (0) | 2025.03.06 |
| [프로그래머스] 가장 큰 수(Java) (0) | 2025.02.26 |
| [프로그래머스] 전력망을 둘로 나누기(Java) (0) | 2025.02.25 |
| [프로그래머스] 소수 찾기(Java) (0) | 2025.02.24 |