Applied Intuition Interview Question

Question was a graph traversal problem on a grid