Let's think of the grid in this problem as an undirected graph. For each node of the graph, we must check all its adjacent nodes to find a clear path. Can you recall a graph algorithm that can be used for checking adjacent nodes and shortest paths? One of our two favorite graph traversal algorithms fits this criterion, which is the Breadth First Search (BFS)
algorithm.