Publicis Sapient interview question

String manipulation and array manipulation