Pregunta de entrevista de LocoNav

a question based on dynamic programming. a star grid problem.