Pregunta de entrevista de Meta

basic graph problem found on leetcode