public int hIndex(int[] citations) {
int h=0;
Arrays.sort(citations);
int i=citations.length-1;
while(i>=0 && citations[i]>h){
h++;
i--;
}
return h;
}
public int hIndex(int[] citations) {
int h=0;
Arrays.sort(citations);
int i=citations.length-1;
while(i>=0 && citations[i]>h){
h++;
i--;
}
return h;
}