Given an array of bar heights, find the largest rectangle that fits entirely under the histogram. The rectangle must have bars as its base.
This is LeetCode , the classic monotonic stack problem. For each bar, find how far left and right it can extend as the minimum height.