Hudson River Trading interview question

Solve abstract math problem using Python