Problem Submissions Solution

Histogram Max Rectangular Area

Difficulty: Hard

Acceptance: %

Points: 40.00

You are given a histogram represented by an array arr, where each element represents the height of a bar, and all bars have a uniform width of 1 unit. Your task is to determine the largest rectangular area that can be formed using one or more consecutive bars in the histogram.

Topics

Companies

Articles

Examples:

Expected Time Complexity: O(n)

Expected Auxiliary Space: O(1)

Constraints:
  • 1 <= arr.size() <= 10^5
  • 0 <= arr[i] <= 10^3
Companies:
Microsoft Google
Topics:
Stack
Locked Content
Access Restricted: Please Login to access the code editor and test cases.