public int canCompleteCircuit1(int[] gas, int[] cost) {
        for(int i =0;i< gas.length;i++){
            if(gas[i] >= cost[i]){
                if(canFinish(gas,cost,i))
                    return i;
            }
        }
        return -1;
    }