Skip to content

Commit ad0b3a2

Browse files
committed
Create README - LeetHub
source:8332259aaf31e25dd5129f7f91d79e41a6ec498b
1 parent b26d6e4 commit ad0b3a2

File tree

1 file changed

+36
-0
lines changed
  • 공예영/5주차/0021-merge-two-sorted-lists

1 file changed

+36
-0
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<h2><a href="https://leetcode.com/problems/merge-two-sorted-lists">21. Merge Two Sorted Lists</a></h2><h3>Easy</h3><hr><p>You are given the heads of two sorted linked lists <code>list1</code> and <code>list2</code>.</p>
2+
3+
<p>Merge the two lists into one <strong>sorted</strong> list. The list should be made by splicing together the nodes of the first two lists.</p>
4+
5+
<p>Return <em>the head of the merged linked list</em>.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/03/merge_ex1.jpg" style="width: 662px; height: 302px;" />
10+
<pre>
11+
<strong>Input:</strong> list1 = [1,2,4], list2 = [1,3,4]
12+
<strong>Output:</strong> [1,1,2,3,4,4]
13+
</pre>
14+
15+
<p><strong class="example">Example 2:</strong></p>
16+
17+
<pre>
18+
<strong>Input:</strong> list1 = [], list2 = []
19+
<strong>Output:</strong> []
20+
</pre>
21+
22+
<p><strong class="example">Example 3:</strong></p>
23+
24+
<pre>
25+
<strong>Input:</strong> list1 = [], list2 = [0]
26+
<strong>Output:</strong> [0]
27+
</pre>
28+
29+
<p>&nbsp;</p>
30+
<p><strong>Constraints:</strong></p>
31+
32+
<ul>
33+
<li>The number of nodes in both lists is in the range <code>[0, 50]</code>.</li>
34+
<li><code>-100 &lt;= Node.val &lt;= 100</code></li>
35+
<li>Both <code>list1</code> and <code>list2</code> are sorted in <strong>non-decreasing</strong> order.</li>
36+
</ul>

0 commit comments

Comments
 (0)