Cognizant Interview Question

Simple logic and array based questions