Skip to content

Commit d21081e

Browse files
committed
Create README - LeetHub
1 parent 3effc3c commit d21081e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

merge-intervals/README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<h2>56. Merge Intervals</h2><h3>Medium</h3><hr><div><p>Given an array&nbsp;of <code>intervals</code>&nbsp;where <code>intervals[i] = [start<sub>i</sub>, end<sub>i</sub>]</code>, merge all overlapping intervals, and return <em>an array of the non-overlapping intervals that cover all the intervals in the input</em>.</p>
2+
3+
<p>&nbsp;</p>
4+
<p><strong>Example 1:</strong></p>
5+
6+
<pre><strong>Input:</strong> intervals = [[1,3],[2,6],[8,10],[15,18]]
7+
<strong>Output:</strong> [[1,6],[8,10],[15,18]]
8+
<strong>Explanation:</strong> Since intervals [1,3] and [2,6] overlaps, merge them into [1,6].
9+
</pre>
10+
11+
<p><strong>Example 2:</strong></p>
12+
13+
<pre><strong>Input:</strong> intervals = [[1,4],[4,5]]
14+
<strong>Output:</strong> [[1,5]]
15+
<strong>Explanation:</strong> Intervals [1,4] and [4,5] are considered overlapping.
16+
</pre>
17+
18+
<p>&nbsp;</p>
19+
<p><strong>Constraints:</strong></p>
20+
21+
<ul>
22+
<li><code>1 &lt;= intervals.length &lt;= 10<sup>4</sup></code></li>
23+
<li><code>intervals[i].length == 2</code></li>
24+
<li><code>0 &lt;= start<sub>i</sub> &lt;= end<sub>i</sub> &lt;= 10<sup>4</sup></code></li>
25+
</ul>
26+
</div>

0 commit comments

Comments
 (0)