Pregunta de entrevista de One New Zealand

question related to graph algorithm