Skip to content

Commit 66993d1

Browse files
committed
[20251118] PGM / LV2 / H-Index / 김민진
1 parent 8504ccc commit 66993d1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
```java
2+
import java.util.Arrays;
3+
4+
public class PGJ_LV2_H_Index {
5+
6+
private static int len;
7+
8+
public int solution(int[] citations) {
9+
int answer = 0;
10+
len = citations.length;
11+
Arrays.sort(citations);
12+
13+
for (int i = 0; i < len; i++) {
14+
int h = Math.min(len - i, citations[i]);
15+
answer = Math.max(answer, h);
16+
}
17+
return answer;
18+
}
19+
20+
}
21+
```

0 commit comments

Comments
 (0)