Pergunta de entrevista da empresa Applied Intuition

Question was a graph traversal problem on a grid