Pregunta de entrevista de Goldman Sachs

Technical Test had a question regarding Graphs in DSA