Aloha Technology interview question

From string and array program