Pregunta de entrevista de Videocites

Data structures and time complexity question