Pregunta de entrevista de Thoucentric

Coding from data structure. Time complexity.