Pregunta de entrevista de 1plusX

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