Skip to content

Commit 9b86e34

Browse files
Create README - LeetHub
1 parent 0b18533 commit 9b86e34

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<h2>84. Largest Rectangle in Histogram</h2><h3>Hard</h3><hr><div><p>Given an array of integers <code>heights</code> representing the histogram's bar height where the width of each bar is <code>1</code>, return <em>the area of the largest rectangle in the histogram</em>.</p>
2+
3+
<p>&nbsp;</p>
4+
<p><strong>Example 1:</strong></p>
5+
<img alt="" src="https://assets.leetcode.com/uploads/2021/01/04/histogram.jpg" style="width: 522px; height: 242px;">
6+
<pre><strong>Input:</strong> heights = [2,1,5,6,2,3]
7+
<strong>Output:</strong> 10
8+
<strong>Explanation:</strong> The above is a histogram where width of each bar is 1.
9+
The largest rectangle is shown in the red area, which has an area = 10 units.
10+
</pre>
11+
12+
<p><strong>Example 2:</strong></p>
13+
<img alt="" src="https://assets.leetcode.com/uploads/2021/01/04/histogram-1.jpg" style="width: 202px; height: 362px;">
14+
<pre><strong>Input:</strong> heights = [2,4]
15+
<strong>Output:</strong> 4
16+
</pre>
17+
18+
<p>&nbsp;</p>
19+
<p><strong>Constraints:</strong></p>
20+
21+
<ul>
22+
<li><code>1 &lt;= heights.length &lt;= 10<sup>5</sup></code></li>
23+
<li><code>0 &lt;= heights[i] &lt;= 10<sup>4</sup></code></li>
24+
</ul>
25+
</div>

0 commit comments

Comments
 (0)