Jane Street interview question

I recommend searching on math stack exchange.