1plusX Interview Question

Algorithmic question that required a monotonic queue for the optimal solution.