ByteDance interview question

Dynamic Programming to search a maze.