Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 462 Bytes

File metadata and controls

13 lines (10 loc) · 462 Bytes

Problem 16: Columnar Capacity

Problem Statement

Given an array of integers heights representing a histogram's bar height where the width of each bar is 1, find the area of the largest rectangle in the histogram.

Input Format

  • An array of integers heights.

Example

Input: heights = [2, 1, 5, 6, 2, 3]
Output: 10
Explanation: The largest rectangle is formed by the bars with heights 5 and 6, with width 2. Area = 5 * 2 = 10.