Applied Intuition interview question

Question was a graph traversal problem on a grid