Escape the Maze — Solution & Editorial
Plain BFS on the grid graph — the first time T is reached is optimal because all steps cost 1.
Complexity: O(NM)
Plain BFS on the grid graph — the first time T is reached is optimal because all steps cost 1.
Complexity: O(NM)