Accenture Interview Question

Simple array and string based coding