94. Largest Rectangle in Histogram

Find the area of the largest rectangle in a histogram.
Example 1
Input: heights = [2,4]
Output: 4
Explanation: A rectangle spanning two columns.
Example 2
Input: heights = [2,1,5,6,2,3]
Output: 10
Explanation: The maximum rectangle has height 5 and width 2.
arrayshardrecursion
JavaScript
Loading...
Line 1, Char 1