Skip to content

Commit 142e008

Browse files
committed
Create README - LeetHub
1 parent d055b48 commit 142e008

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

23-merge-k-sorted-lists/README.md

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<h2><a href="https://leetcode.com/problems/merge-k-sorted-lists/">23. Merge k Sorted Lists</a></h2><h3>Hard</h3><hr><div><p>You are given an array of <code>k</code> linked-lists <code>lists</code>, each linked-list is sorted in ascending order.</p>
2+
3+
<p><em>Merge all the linked-lists into one sorted linked-list and return it.</em></p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong>Example 1:</strong></p>
7+
8+
<pre><strong>Input:</strong> lists = [[1,4,5],[1,3,4],[2,6]]
9+
<strong>Output:</strong> [1,1,2,3,4,4,5,6]
10+
<strong>Explanation:</strong> The linked-lists are:
11+
[
12+
1-&gt;4-&gt;5,
13+
1-&gt;3-&gt;4,
14+
2-&gt;6
15+
]
16+
merging them into one sorted list:
17+
1-&gt;1-&gt;2-&gt;3-&gt;4-&gt;4-&gt;5-&gt;6
18+
</pre>
19+
20+
<p><strong>Example 2:</strong></p>
21+
22+
<pre><strong>Input:</strong> lists = []
23+
<strong>Output:</strong> []
24+
</pre>
25+
26+
<p><strong>Example 3:</strong></p>
27+
28+
<pre><strong>Input:</strong> lists = [[]]
29+
<strong>Output:</strong> []
30+
</pre>
31+
32+
<p>&nbsp;</p>
33+
<p><strong>Constraints:</strong></p>
34+
35+
<ul>
36+
<li><code>k == lists.length</code></li>
37+
<li><code>0 &lt;= k &lt;= 10<sup>4</sup></code></li>
38+
<li><code>0 &lt;= lists[i].length &lt;= 500</code></li>
39+
<li><code>-10<sup>4</sup> &lt;= lists[i][j] &lt;= 10<sup>4</sup></code></li>
40+
<li><code>lists[i]</code> is sorted in <strong>ascending order</strong>.</li>
41+
<li>The sum of <code>lists[i].length</code> will not exceed <code>10<sup>4</sup></code>.</li>
42+
</ul>
43+
</div>

0 commit comments

Comments
 (0)