Learn
Practice
Newsletter
Resources
F
Toggle theme
0
F
Toggle theme
0
Toggle menu
← Back to All Animations
Largest Rectangle in Histogram
Bookmark
Input
Example 1
Example 2
Example 3
Ascending
Descending
Custom
heights
=
[2, 1, 5, 6, 2, 3]
2
0
1
1
5
2
6
3
2
4
3
5
stack
algo
master
.
io
Step:
Start of algorithm
Variable
Value
heights
Array(6) [2, 1, 5...]
max_area
-
stack
-
i
-
Variable
Value
current_area
-
height
-
width
-
0 / 32
Input
Example 1
Example 2
Example 3
Ascending
Descending
Custom
heights
=
[2, 1, 5, 6, 2, 3]
0 / 32
2
0
1
1
5
2
6
3
2
4
3
5
stack
algo
master
.
io
Step:
Start of algorithm
Visualization
Variables