Pergunta de entrevista da empresa Hudson River Trading

Solve abstract math problem using Python