Accenture Interview Question

Explain the thought behind the solution.