Question d’entretien chez EPAM Systems

Can you evaluate the algorithm's complexity?