Pregunta de entrevista de Zalando

Whats code time complexity? How can it be improved?