Pregunta de entrevista de Groq

DFS based to create input and output nodes