numeric·Software Engineer·Technical Phone Screen
- A spaceship travels from a start position toward a target along a 1-D axis, with a fixed starting fuel and a list of refueling stations (each with a position and fuel amount). Every unit of distance costs one unit of fuel. What is the minimum number of stops needed to reach the target, or -1 if it's impossible?
“My first instinct was DP and I started going down that road before catching myself.”