Optiver Interview Question

scripting challenge