-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.java
More file actions
23 lines (17 loc) · 513 Bytes
/
test.java
File metadata and controls
23 lines (17 loc) · 513 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import java.util.*;
class Solution {
public int solution(int[] citations) {
int answer = 0;
Arrays.sort(citations);
System.out.println(Arrays.toString(citations));
for(int i= 0;i<citations.length;i++){
int remainLen = citations.length - i;
System.out.println(citations[i]+"ll"+ remainLen);
if(citations[i] >= remainLen){
answer = remainLen;
break;
}
}
return answer;
}
}