Jane Street Interview Question

calculations