1class Solution {2 public int hIndex(int[] citations) {3 int n = citations.length;4 Arrays.sort(citations);5 for (int i = 0; i < n; i++) {6 int hlen = (n - 1) - i + 1;7 if (citations[i] >= hlen) {8 return hlen;9 }10 }11 return 0;12 }13}
WPM •0 •0
ACC •0 •0
TIME •0