ServiceNow interview question

Algorithm using dynamic programming. Find the optimal solution to complete a maze.