Pergunta de entrevista da empresa Standard Chartered Bank

graph question based on dfs.