<awangdev>275. H-Index II_1.java
public int hIndex(int[] citations) {
        if (citations == null || citations.length == 0) {
        	return 0;
        }
        int n = citations.length;
        int start = 0, end = n - 1;
        while (start + 1 < end) {
        	int mid = start + (end - start) / 2;
            int h = n - mid;
            if (citations[mid] < h) start = mid;
            else { 
        		if (mid - 1 >= 0 && citations[mid - 1] <= h) return h;  
                end = mid;
            }
        }
        if (citations[start] >= n - start) return n - start;
        if (citations[end] >= n - end) return n - end;
        return 0;
    }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 == null || var_0 . length == 0 ) {
    return 0 ;
  }
  int var_4 = var_0 . length ;
  int var_5 = 0 , var_7 = var_4 - 1 ;
  while ( var_5 + 1 < var_7 ) {
    int var_9 = var_5 + ( var_7 - var_5 ) / 2 ;
    int var_10 = var_4 - var_9 ;
    if ( var_0 [ var_9 ] < var_10 ) var_5 = var_9 ;
    else {
      if ( var_9 - 1 >= 0 && var_0 [ var_9 - 1 ] <= var_10 ) return var_10 ;
      var_7 = var_9 ;
    }
  }
  if ( var_0 [ var_5 ] >= var_4 - var_5 ) return var_4 - var_5 ;
  if ( var_0 [ var_7 ] >= var_4 - var_7 ) return var_4 - var_7 ;
  return 0 ;
}
