Stop only when you are stuck
transcript
A car starts with a small charge. Stations along the road add more. Reach the target with the fewest stops.
Do not stop when you reach a station. Push its charge into a heap. Keep driving while you still can. Your reach grows only when you really stop.
Target thirty, start charge eight. At station twelve, you are out of reach. Stop at the largest charge passed, six. Then ten, then nine. Three stops.
The tempting stop is the most recent one. Its charge may be tiny. The largest charge buys the most reach. On this road that saves one stop. A smaller charge never beats a larger one.
Only when you are stuck, take the largest. Count that as one stop. If no passed station is left, return minus one.
Passing a station costs nothing. A stop is paid for only when needed. Always take the largest passed charge, never the nearest one. Full breakdown in the lecture.