Question
There are stations arranged 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 the next. Starting with an empty tank at some station, return the starting index from which you can complete the full loop, or -1 if impossible. If a solution exists it is unique. Both lists have equal length and at least one element.
gas_station(gas: list[int], cost: list[int]) → int[[1,2,3,4,5],[3,4,5,1,2]]out3State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.