<gouthampradhan>array_HIndex_1.java
public int hIndex(int[] citations) {
    int n = citations.length;
    int[] count = new int[n + 1];
    int[] S = new int[n + 1];
    for (int i = 0; i < citations.length; i++) {
      if (citations[i] > n) {
        citations[i] = n;
      }
    }
    for (int citation : citations) {
      count[citation]++;
    }
    S[n] = count[n];
    for (int i = n - 1; i >= 0; i--) {
      S[i] = count[i] + S[i + 1];
    }
    for (int i = n; i >= 0; i--) {
      if (i <= S[i]) {
        return i;
      }
    }
    return 0;
  }
public int sample_funcname ( int [ ] var_0 ) {
  int var_2 = var_0 . length ;
  int [ ] var_4 = new int [ var_2 + 1 ] ;
  int [ ] var_5 = new int [ var_2 + 1 ] ;
  for ( int var_7 = 0 ;
  var_7 < var_0 . length ;
  var_7 ++ ) {
    if ( var_0 [ var_7 ] > var_2 ) {
      var_0 [ var_7 ] = var_2 ;
    }
  }
  for ( int var_8 : var_0 ) {
    var_4 [ var_8 ] ++ ;
  }
  var_5 [ var_2 ] = var_4 [ var_2 ] ;
  for ( int var_7 = var_2 - 1 ;
  var_7 >= 0 ;
  var_7 -- ) {
    var_5 [ var_7 ] = var_4 [ var_7 ] + var_5 [ var_7 + 1 ] ;
  }
  for ( int var_7 = var_2 ;
  var_7 >= 0 ;
  var_7 -- ) {
    if ( var_7 <= var_5 [ var_7 ] ) {
      return var_7 ;
    }
  }
  return 0 ;
}
