Skip to content

Commit 72bd207

Browse files
Merge pull request #178 from Coding-Crew-Forever/hh830/algorithm
[2025년 5월 셋째주 / hh830] 정렬
2 parents 3ebab67 + 405f362 commit 72bd207

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

hh830/PGS_42747.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import java.util.*;
2+
3+
class Solution {
4+
public int solution(int[] citations) {
5+
Arrays.sort(citations);
6+
7+
int n = citations.length;
8+
9+
for(int i=0;i<n;i++){
10+
int answer = n-i;
11+
if(citations[i] >= answer){
12+
return answer;
13+
}
14+
}
15+
16+
return 0;
17+
}
18+
}

0 commit comments

Comments
 (0)