Enough fuel for exactly one lap
Several fuel stations are placed at arbitrary points around a circular road. Between them they hold exactly the amount of fuel needed for a car to drive once around the whole circle. The car has an unlimited-capacity tank but starts empty, and it may only take fuel from a station when it is at that station.
Prove that there is at least one station from which the car can start, driving in the clockwise direction, and complete the entire lap without ever running out of fuel.
Show a hint
Pretend the car starts anywhere with a large enough loan of fuel to make the lap, and plot the fuel gauge as it goes round. Where should the real start be?
Your answer
Solving needs a free account
Answers, streaks and solutions unlock when you are signed in. Reading the question and the hint stays free.
Discussion
💡 Discussion rules
- No full solutions here. Hints and approaches only.
- Complexity, edge cases and intuition are the point.
- Interview experiences are welcome. Respect your NDAs.
Loading discussion…
Learn the concepts
The theory behind this question.