Pregunta de entrevista de Amazon

the LC high frequency problem (using dfs or bfs)