Largest Rectangle in Histogram
Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram.
Largest Rectangle in Histogram

Given an array of integers heights representing the histogram's bar height where the width of each bar is 1, return the area of the largest rectangle in the histogram.

Example 1:
Input: [2,1,5,6,2,3]
Output: 10
Input
arr =[2,1,5,6,2,3]

Start

2
0
1
1
5
2
6
3
2
4
3
5
Max Area

0

Stack (Indices)

[]

Variables
No variables to display
DepthFunction Call
Stack empty
0/26