Skip to content

Commit e0d6849

Browse files
Added README.md file for Russian Doll Envelopes
1 parent 25ff22b commit e0d6849

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<h2><a href="https://leetcode.com/problems/russian-doll-envelopes">Russian Doll Envelopes</a></h2> <img src='https://img.shields.io/badge/Difficulty-Hard-red' alt='Difficulty: Hard' /><hr><p>You are given a 2D array of integers <code>envelopes</code> where <code>envelopes[i] = [w<sub>i</sub>, h<sub>i</sub>]</code> represents the width and the height of an envelope.</p>
2+
3+
<p>One envelope can fit into another if and only if both the width and height of one envelope are greater than the other envelope&#39;s width and height.</p>
4+
5+
<p>Return <em>the maximum number of envelopes you can Russian doll (i.e., put one inside the other)</em>.</p>
6+
7+
<p><strong>Note:</strong> You cannot rotate an envelope.</p>
8+
9+
<p>&nbsp;</p>
10+
<p><strong class="example">Example 1:</strong></p>
11+
12+
<pre>
13+
<strong>Input:</strong> envelopes = [[5,4],[6,4],[6,7],[2,3]]
14+
<strong>Output:</strong> 3
15+
<strong>Explanation:</strong> The maximum number of envelopes you can Russian doll is <code>3</code> ([2,3] =&gt; [5,4] =&gt; [6,7]).
16+
</pre>
17+
18+
<p><strong class="example">Example 2:</strong></p>
19+
20+
<pre>
21+
<strong>Input:</strong> envelopes = [[1,1],[1,1],[1,1]]
22+
<strong>Output:</strong> 1
23+
</pre>
24+
25+
<p>&nbsp;</p>
26+
<p><strong>Constraints:</strong></p>
27+
28+
<ul>
29+
<li><code>1 &lt;= envelopes.length &lt;= 10<sup>5</sup></code></li>
30+
<li><code>envelopes[i].length == 2</code></li>
31+
<li><code>1 &lt;= w<sub>i</sub>, h<sub>i</sub> &lt;= 10<sup>5</sup></code></li>
32+
</ul>

0 commit comments

Comments
 (0)