Apna Mart interview question

basic leetcode array and string manipulation question