Tech Mahindra Interview Question

logical reasoning.