There are n gas stations in a circle. gas[i] is the fuel available at station i, and cost[i] is the fuel needed to drive from station i to station i + 1. Starting with an empty tank at some station, return the index you must start from to complete the full circuit, or -1 if it's impossible. If a solution exists, it's guaranteed unique.
If the tank ever goes negative starting from some station, no station between the last valid start and here could have worked either — so jump the candidate start straight past the failure point.
Example
Input: gas = [1, 2, 3, 4, 5], cost = [3, 4, 5, 1, 2]
Output: 3