Pregunta de entrevista de Tally Solutions

DSA easy to medium level question