← ALL NOTES
Array

84. Largest Rectangle in Histogram

For each bar treated as the ceiling, the largest rectangle using it stretches left and right until the first strictly shorter bar. Finding all those boundaries in O(n) total is the job of a monotonic…

Loading…