Problem 962 · Medium

Maximum Width Ramp

Find the widest pair of positions where the earlier value is no greater than the later value. The visual uses a monotonic stack and a sweep from the right.

Open the interactive visualisation