EPAM Systems Interview Question

How to solve this specific problem