EPAM Systems Interview Question

Simple leetcode easy question working with array and strings