Cognizant Interview Question

Max ele with some condition