Leetcode 84. Largest Rectangle in Histogram
Find the maximum area of a rectangle formed by contiguous bars in a histogram (given bar heights). The core challenge is determining each bar's maximal span of consecutive bars at least that tall — typically solved in O(n) with a monotonic stack to find nearest smaller elements (n up to 1e5).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
Your account is free and you can post anonymously if you choose.