Pregunta de entrevista de ByteDance

Graph problem similar to leetcode