<gouthampradhan>binary_search_HIndexII_1.java
public int hIndex(int[] citations) {
    if (citations.length == 0) return 0;
    int s = 0, e = citations.length;
    int ans = -1;
    while (s < e) {
      int m = (s + e) >>> 1;
      int cit = citations.length - m;
      if (citations[m] > cit) {
        if (ans < cit) {
          ans = cit;
        }
        e = m;
      } else {
        if (ans < citations[m]) {
          ans = citations[m];
        }
        s = m + 1;
      }
    }
    return ans;
  }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 . length == 0 ) return 0 ;
  int var_3 = 0 , var_4 = var_0 . length ;
  int var_6 = - 1 ;
  while ( var_3 < var_4 ) {
    int var_7 = ( var_3 + var_4 ) >>> 1 ;
    int var_8 = var_0 . length - var_7 ;
    if ( var_0 [ var_7 ] > var_8 ) {
      if ( var_6 < var_8 ) {
        var_6 = var_8 ;
      }
      var_4 = var_7 ;
    }
    else {
      if ( var_6 < var_0 [ var_7 ] ) {
        var_6 = var_0 [ var_7 ] ;
      }
      var_3 = var_7 + 1 ;
    }
  }
  return var_6 ;
}
