Pergunta de entrevista da empresa Accenture

Explain the thought behind the solution.