Cognizant Coding Question- 2