Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

84.Largest Rectangle in Histogram #22

Open
soulhat opened this issue Sep 26, 2020 · 0 comments
Open

84.Largest Rectangle in Histogram #22

soulhat opened this issue Sep 26, 2020 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@soulhat
Copy link
Owner

soulhat commented Sep 26, 2020

Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in the histogram.

image

Above is a histogram where width of each bar is 1, given height = [2,1,5,6,2,3].

image

The largest rectangle is shown in the shaded area, which has area = 10 unit.

Example:

Input: [2,1,5,6,2,3]
Output: 10
@soulhat soulhat added the enhancement New feature or request label Sep 26, 2020
@soulhat soulhat self-assigned this Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant