Maximum Area Histogram
Hard

Problem Statement

Find the largest rectangular area possible in a given histogram where the largest rectangle can be made of a number of contiguous bars. Assume that all bars have the same width of 1 unit.

Examples

1Example 1
Input:
{ "heights": [ 2, 1, 5, 6, 2, 3 ] }
Output:
10
2Example 2
Input:
{ "heights": [ 6, 2, 5, 4, 5, 1, 6 ] }
Output:
12
3Example 3
Input:
{ "heights": [ 2, 4 ] }
Output:
4
Loading...

Sign in to Run Code and Submit