Tech Mahindra Interview Question

Nothing much difficult