The list heights describes a bar chart (histogram). Every bar is 1 unit wide, and heights[i] is the height of bar i.
Draw the biggest rectangle that fits inside the bars. It can cover several bars in a row, and its height cannot go above the shortest bar it covers. Return the area of that rectangle.
Examples
Example 1:
Input: heights = [4,2,6,3,3,3]
Output: 12
Explanation: Cover the last four bars (6, 3, 3, 3) with height 3 and width 4. Area = 12. Covering all six bars with height 2 also gives 12.
Example 2:
Input: heights = [5,5,5]
Output: 15
Explanation: All three bars together: height 5, width 3. Area = 15.
Example 3:
Input: heights = [0,4]
Output: 4
Explanation: The second bar alone gives height 4, width 1. Area = 4.