Jane Street interview question

Two part programming exercise on coderpad