Cognizant Interview Question

Arrays in a string coding question