Cognizant Interview Question

basic coding, logical reasoning and analysis