EPAM Systems interview question

Coding round - string manipulations.