Hard
Find the largest rectangle area in a histogram.
Given bar heights of width 1, return the area of the largest rectangle that can be formed in the histogram.
Examples
Input: heights = [2,1,5,6,2,3]
Output: 10
Constraints
- 1 <= heights.length
Coding Challenge
Find the largest rectangle area in a histogram.
Given bar heights of width 1, return the area of the largest rectangle that can be formed in the histogram.
Input: heights = [2,1,5,6,2,3]
Output: 10
Preparing your coding workspace...