Jane Street Interview Question

I recommend searching on math stack exchange.