<awangdev>274.H-Index_1.java
public int hIndex(int[] citations) {
        if (citations == null || citations.length == 0) {
        	return 0;
        }
 		int n = citations.length;
 		int[] bucket = new int[n + 1]; 
 		for (int i = 0; i < n; i++) {
 			int bucketSlot = citations[i];
 			if (bucketSlot <= n) bucket[bucketSlot]++;
            else bucket[n]++; 
 		}

 		int sum = 0;
 		for (int h = n; h >= 0; h--) {
            sum += bucket[h]; 
 			if (sum >= h) return h; 
 		}
      	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_6 = new int [ var_4 + 1 ] ;
  for ( int var_7 = 0 ;
  var_7 < var_4 ;
  var_7 ++ ) {
    int var_8 = var_0 [ var_7 ] ;
    if ( var_8 <= var_4 ) var_6 [ var_8 ] ++ ;
    else var_6 [ var_4 ] ++ ;
  }
  int var_9 = 0 ;
  for ( int var_10 = var_4 ;
  var_10 >= 0 ;
  var_10 -- ) {
    var_9 += var_6 [ var_10 ] ;
    if ( var_9 >= var_10 ) return var_10 ;
  }
  return 0 ;
}
