Domanda di colloquio di Jane Street

Solve this question, walk me through your thinking.