Where to start the loop
Driving a circular route, station i provides gas[i] fuel and it costs cost[i] to
reach the next station. Starting with an empty tank at some station, write
start_station(gas, cost) that returns the index you must start from to complete the
loop, or -1 if impossible. If a solution exists it is unique.
start_station([1, 2, 3, 4, 5], [3, 4, 5, 1, 2]) -> 3
start_station([2, 3, 4], [3, 4, 3]) -> -1
The point is to practise a one-pass greedy: when the tank goes negative, nothing before this point can be the start.
def start_station(gas, cost):
...