Accenture interview question

Coding question on strings and arrays