Tap here to switch tabs
Problem
Submissions

Problem: Largest Rectangle in Histogram

Largest Rectangle in Histogram gives an array of bar heights and asks for the greatest area of a rectangle formed from consecutive bars, each with unit width.

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≤1 \leq heights.length ≤103\leq 10^3
  • 0≤0 \leq heights[i] ≤104\leq 10^4
⋮
Tap here to switch tabs
Problem
Submissions

Problem: Largest Rectangle in Histogram

Largest Rectangle in Histogram gives an array of bar heights and asks for the greatest area of a rectangle formed from consecutive bars, each with unit width.

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≤1 \leq heights.length ≤103\leq 10^3
  • 0≤0 \leq heights[i] ≤104\leq 10^4