Search⌘ K
AI Features

Largest Rectangle in Histogram

Understand how to solve the Largest Rectangle in Histogram problem by applying coding interview patterns. This lesson helps you implement an optimal O(n) time and O(n) space algorithm to identify the maximum rectangular area in a histogram with constant width bars.

Statement

Given an array of integers, heights, that represents the heights of bars in a histogram, find the area of the largest rectangle in the histogram, where the rectangle has a constant width of 11 unit for each bar.

Constraints

  • 1
...