-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
abfa8d4
commit 41331b8
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<h2><a href="https://leetcode.com/problems/merge-two-sorted-lists/">21. Merge Two Sorted Lists</a></h2><h3>Easy</h3><hr><div><p>You are given the heads of two sorted linked lists <code>list1</code> and <code>list2</code>.</p> | ||
|
||
<p>Merge the two lists in a one <strong>sorted</strong> list. The list should be made by splicing together the nodes of the first two lists.</p> | ||
|
||
<p>Return <em>the head of the merged linked list</em>.</p> | ||
|
||
<p> </p> | ||
<p><strong class="example">Example 1:</strong></p> | ||
<img alt="" src="https://assets.leetcode.com/uploads/2020/10/03/merge_ex1.jpg" style="width: 662px; height: 302px;"> | ||
<pre><strong>Input:</strong> list1 = [1,2,4], list2 = [1,3,4] | ||
<strong>Output:</strong> [1,1,2,3,4,4] | ||
</pre> | ||
|
||
<p><strong class="example">Example 2:</strong></p> | ||
|
||
<pre><strong>Input:</strong> list1 = [], list2 = [] | ||
<strong>Output:</strong> [] | ||
</pre> | ||
|
||
<p><strong class="example">Example 3:</strong></p> | ||
|
||
<pre><strong>Input:</strong> list1 = [], list2 = [0] | ||
<strong>Output:</strong> [0] | ||
</pre> | ||
|
||
<p> </p> | ||
<p><strong>Constraints:</strong></p> | ||
|
||
<ul> | ||
<li>The number of nodes in both lists is in the range <code>[0, 50]</code>.</li> | ||
<li><code>-100 <= Node.val <= 100</code></li> | ||
<li>Both <code>list1</code> and <code>list2</code> are sorted in <strong>non-decreasing</strong> order.</li> | ||
</ul> | ||
</div> |