<gouthampradhan>array_LargestNumberAtLeastTwice_1.java
public int dominantIndex(int[] nums) {
    int index = 0, max = Integer.MIN_VALUE;
    for (int i = 0; i < nums.length; i++) {
      if (nums[i] > max) {
        max = nums[i];
        index = i;
      }
    }
    for (int i = 0; i < nums.length; i++) {
      if (i == index) continue;
      if (((long) nums[i] * 2) > max) {
        return -1;
      }
    }
    return index;
  }
public int sample_funcname ( int [ ] var_0 ) {
  int var_2 = 0 , var_5 = Integer . MIN_VALUE ;
  for ( int var_6 = 0 ;
  var_6 < var_0 . length ;
  var_6 ++ ) {
    if ( var_0 [ var_6 ] > var_5 ) {
      var_5 = var_0 [ var_6 ] ;
      var_2 = var_6 ;
    }
  }
  for ( int var_6 = 0 ;
  var_6 < var_0 . length ;
  var_6 ++ ) {
    if ( var_6 == var_2 ) continue ;
    if ( ( ( long ) var_0 [ var_6 ] * 2 ) > var_5 ) {
      return - 1 ;
    }
  }
  return var_2 ;
}
