Optiver Interview Question

A coding question that you need to pass the cases.