Citadel Securities Interview Question

2 lc hard oa, pretty time constrained