<gouthampradhan>greedy_GasStation_1.java
public int canCompleteCircuit(int[] gas, int[] cost) {
    int debt = 0, sum = 0, start = 0;
    for (int i = 0; i < gas.length; i++) {
      sum += gas[i] - cost[i];
      if (sum < 0) {
        debt += sum;
        sum = 0;
        start = i + 1;
      }
    }
    debt += sum;
    return debt >= 0 ? start : -1;
  }
public int sample_funcname ( int [ ] var_0 , int [ ] var_1 ) {
  int var_3 = 0 , var_4 = 0 , var_5 = 0 ;
  for ( int var_6 = 0 ;
  var_6 < var_0 . length ;
  var_6 ++ ) {
    var_4 += var_0 [ var_6 ] - var_1 [ var_6 ] ;
    if ( var_4 < 0 ) {
      var_3 += var_4 ;
      var_4 = 0 ;
      var_5 = var_6 + 1 ;
    }
  }
  var_3 += var_4 ;
  return var_3 >= 0 ? var_5 : - 1 ;
}
