EPAM Systems interview question

How to solve this specific problem