Problem - Largest Rectangle in Histogram

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 8484, the classic monotonic stack problem. For each bar, find how far left and right it can extend as the minimum height.