Pergunta de entrevista da empresa Bank of America

A python algorithm question