LocoNav interview question

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