Cognizant interview question

Coding in array problems and strings