Skip to content

Commit f5d44c4

Browse files
committed
Added images for examples of 0084-largest-rectangle-in-histogram.md
1 parent d01f1bc commit f5d44c4

3 files changed

Lines changed: 9 additions & 7 deletions

File tree

images/examples/0084_1.jpg

12.3 KB
Loading

images/examples/0084_2.jpg

6.74 KB
Loading

problems/0084-largest-rectangle-in-histogram.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ LeetCode problem: [84. Largest Rectangle in Histogram](https://leetcode.com/prob
44
## LeetCode problem description
55
Given an array of integers `heights` representing the histogram's bar height where the width of each bar is `1`, return the area of the largest rectangle in the histogram.
66

7+
### Example 1
8+
![](../images/examples/0084_1.jpg)
79
```
8-
------------------------------------------------------------------------
9-
[Example 1]
10-
1110
Input: heights = [2,1,5,6,2,3]
1211
Output: 10
1312
1413
Explanation: The above is a histogram where width of each bar is 1.
1514
The largest rectangle is shown in the red area, which has an area = 10 units.
16-
------------------------------------------------------------------------
17-
[Example 2]
15+
```
1816

17+
### Example 2
18+
![](../images/examples/0084_2.jpg)
19+
```
1920
Input: heights = [2,4]
2021
Output: 4
21-
------------------------------------------------------------------------
22-
[Constraints]
22+
```
2323

24+
### Constraints
25+
```
2426
1 <= heights.length <= 100000
2527
0 <= heights[i] <= 10000
2628
------------------------------------------------------------------------

0 commit comments

Comments
 (0)