Pregunta de entrevista de TikTok

about a graph algorithm and very hard