Shortest path between two cells in a grid

0
Remix

Given a grid with open and blocked cells, return the length of the shortest path from a start cell to a target cell moving up, down, left and right. A follow-up changes the question so that a depth-first search with memoization (dynamic programming over the grid) is the natural tool, so be ready to move between BFS and DFS with a memo.

SnowflakeTechnical phone screenLast asked Feb 2026
No answer yet. Write the first one; the best answer gets endorsed.