Pregunta de entrevista de Google

OOPS bassed DSA Question- faced difficulty