Pregunta de entrevista de Waymo

Dynamic programming question with follow up questions