Pregunta de entrevista de Accenture

Coding question on strings and arrays