Dsa
Monotonic Stack
Easy
Maximum Rectangle in Histogram
Given an array representing the heights of bars in a histogram, find the area of the largest rectangle that can be formed under the histogram.
Input format:
- A single line containing space-separated integers representing the heights of the histogram bars.
Output format:
- A single integer representing the area of the largest rectangle.
Example:
Input:
2 1 5 6 2 3
Output:
10
Key concepts
monotonic_stackhistogramrectangle
Practise this out loud — free
Start a mock interview on THIS exact question — a voice AI interviewer opens with it, pushes back like a real onsite, then hands you an instant scorecard.
🎙 Practise this question now