Skip to main content
Largest Rectangle in Histogram | AlgoCracked
AlgoCracked
ProblemsLargest Rectangle in Histogram
Hard44.0% acceptance
Blind75ArrayStackMonotonic Stack

Largest Rectangle in Histogram

Given an array heights where each element is the height of a bar of width 1 in a histogram, return the area of the largest rectangle that fits entirely within the histogram. Input format Input is a single array, e.g. [[2,1,5,6,2,3]] .

Loading workspace…