Pregunta de entrevista de Goldman Sachs

DSA question based on stack