Mphasis interview question

problem solving on strings and array. basically DSA questions