Pergunta de entrevista da empresa FinBox

Given problematic question and said to solve it.