Pregunta de entrevista de Uber

A classic dfs problem. clear code and logic is expected