Citadel Securities Interview Question

Programming problem, and dynamic one