Pregunta de entrevista de Microsoft

Pretty standard graph question testing recursion