Domanda di colloquio di Jane Street

question had three parts, didn't run code