Maximum Rectangle Area In Histogram

easy
1. You are given a array and each value represents the height of the bar.
  2. Assume width of each bar is 1 unit.
  3. Find the maximum rectangle area in the histogram.

Input Format

Given a array of positive integers

Output Format

Return an integer

Constraints

size of array: 1<= N <= 1000
  1 <= Arr[i] <=10^4

Notice

Try First, Check Solution later

1. You should first read the question and watch the question video.
2. Think of a solution approach, then try and submit the question on editor tab.
3. We strongly advise you to watch the solution video for prescribed approach.

Example

Input
6 2 1 5 6 2 3
Output
10
Previous
Cloning Linked List With Random Pointers And Next
Next
Making Calculator

Related Questions