LeetCode 134: Gas Station — Step-by-Step Visual Trace
Medium — Greedy | Array | Simulation
The Problem
Find the starting gas station index from which you can complete a circular trip, where each station has gas to collect and cost to travel to the next station.
Approach
Use a greedy single-pass algorith...
blog.tracelit.dev1 min read