LeetCode MEDIUM 134 Gas Station Summary
Generated by Codex with GPT-5
Quick facts
- Difficulty:
MEDIUM - Problem: Gas Station
- Topics:
Array,Greedy
Problem gist
There are n gas stations arranged in a circle. Station i provides gas[i] units of fuel, and driving from station i to the next station costs cost[i] units. The car starts with an empty tank. The task is to return an index from which the car can complete one full clockwise circuit, or -1 if no such index exists.