Pregunta de entrevista de EPAM Systems

Can you evaluate the algorithm's complexity?