Pattern Recognition Drill
Medium Greedy
The Problem
Find starting station for a complete circuit, or -1 if impossible.
What approach would you use?
Think about it before scrolling down.
If total_gas >= total_cost, answer exists. Track running surplus; when < 0, reset start to next station. O(n).
Common Trap
Brute force trying every starting station is O(n²). The surplus reset insight gives O(n).