Largest Rectangle in Histogram — Monotonic Stack

Given a row of adjacent bars of varying height, find the biggest flat rectangle that fits across consecutive bars without rising above any.

Monotonic Stack · Hard

More in Monotonic Stack

All algorithm problems