OpenText interview question

coding question using array manipulation and string manipulation