Find whether path exists
A grid is a graph: every cell is a vertex, joined to the cells left, right, above and below it. BFS from the source spreads through open cells, and walls simply never enter the queue.
A grid is a graph: every cell is a vertex, joined to the cells left, right, above and below it. BFS from the source spreads through open cells, and walls simply never enter the queue.