Optiver Interview Question

Dynamic programming coding in python