Optiver Interview Question

Graph traversal question (dynamic programming)