mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
36 lines
1.1 KiB
HTML
36 lines
1.1 KiB
HTML
<p>给定两个以 <strong>有序链表</strong> 形式记录的训练计划 <code>l1</code>、<code>l2</code>,分别记录了两套核心肌群训练项目编号,请合并这两个训练计划,按训练项目编号 <strong>升序</strong> 记录于链表并返回。</p>
|
||
|
||
<p><strong>注意</strong>:新链表是通过拼接给定的两个链表的所有节点组成的。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>l1 = [1,2,4], l2 = [1,3,4]
|
||
<strong>输出:</strong>[1,1,2,3,4,4]</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>l1 = [], l2 = []
|
||
<strong>输出:</strong>[]</pre>
|
||
|
||
<p><strong>示例 3:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>l1 = [], l2 = [0]
|
||
<strong>输出:</strong>[0]</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<p><code>0 <= 链表长度 <= 1000</code></p>
|
||
|
||
<p> </p>
|
||
|
||
<p>注意:本题与主站 21 题相同:<a href="https://leetcode-cn.com/problems/merge-two-sorted-lists/">https://leetcode-cn.com/problems/merge-two-sorted-lists/</a></p>
|
||
|
||
<p> </p>
|