EPAM Systems Interview Question

On the technical interview there was simple algorithmic task.