EPAM Systems interview question

Simple leetcode easy question working with array and strings