Optiver Interview Question

Question about optimisation of graph searching