Pergunta de entrevista da empresa Google

algorithm problem can be solved with dfs