Cognizant Interview Question

Solve a DSA question on arrays