Exercises/#95 Largest Rectangle in Histogram
#95

Largest Rectangle in Histogram

HardπŸ“š Stack & Queue
130 XP

Problem

Given an array of bar heights in a histogram, find the area of the largest rectangle.

Examples

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

Input: heights=[2,4]
Output: 4
stackmonotonic-stack
AI Assistantβ€” powered by AI

Unlock hints progressively β€” start gentle, go deeper only if needed.

πŸ’‘

Level 1: Gentle Nudge

A subtle direction

πŸ—ΊοΈ

Level 2: Approach

The algorithm to use

πŸ”

Level 3: Detailed

Step-by-step guidance

95 / 150

Your Solution

⚑ JavaScript

to save progress and use AI features