<awangdev>747. Largest Number At Least Twice of Others_1.java
public int dominantIndex(int[] nums) {
        if (nums == null || nums.length <= 1) {
            return 0;
        }
        int max = -1;
        int leastMax = -1;
        int index = 0;
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] >= max) {
                leastMax = max;
                max = nums[i];
                index = i;
            } else {
                leastMax = Math.max(leastMax, nums[i]);
            }
        }
        return max >= leastMax * 2 ? index : -1;
    }
public int sample_funcname ( int [ ] var_0 ) {
  if ( var_0 == null || var_0 . length <= 1 ) {
    return 0 ;
  }
  int max = - 1 ;
  int var_6 = - 1 ;
  int var_7 = 0 ;
  for ( int var_8 = 0 ;
  var_8 < var_0 . length ;
  var_8 ++ ) {
    if ( var_0 [ var_8 ] >= max ) {
      var_6 = max ;
      max = var_0 [ var_8 ] ;
      var_7 = var_8 ;
    }
    else {
      var_6 = Math . max ( var_6 , var_0 [ var_8 ] ) ;
    }
  }
  return max >= var_6 * 2 ? var_7 : - 1 ;
}
