Pergunta de entrevista da empresa Amazon

bfs/dfs (connected components to solve if wanted)