Problems > Escape the Maze > Editorial

Escape the Maze — Solution & Editorial

Back to the Problem

Plain BFS on the grid graph — the first time T is reached is optimal because all steps cost 1.

Complexity: O(NM)