Hudson River Trading Interview Question

Solve abstract math problem using Python