Home
Topics
Practice
Roadmap
DSA Tracker
Code Editor
Tech Blogs
More
Sign in
Get started
Loading question...
Feedback
Largest Rectangle in Histogram
Hard
00:00
0 users online
Share
Description
Solution
Submissions
Discussion
Given heights of bars in histogram, find area of largest rectangle.
Sample Input:
[2,1,5,6,2,3]
Sample Output:
10
Hints
Hint 1
Use stack to track increasing heights
Hint 2
Calculate area when finding smaller height
Hint 3
Process remaining stack at end
Code Editor
Reset
Run
Save
Loading...