1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-13 11:21:42 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee

add leetcode problem-cn part5

This commit is contained in:
2022-03-27 20:52:13 +08:00
parent 053330914a
commit c11d601602
326 changed files with 26353 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
<p>给你两个 <strong>非空 </strong>链表来代表两个非负整数。数字最高位位于链表开始位置。它们的每个节点只存储一位数字。将这两数相加会返回一个新的链表。</p>
<p>你可以假设除了数字 0 之外,这两个数字都不会以零开头。</p>
<p>&nbsp;</p>
<p><strong>示例1</strong></p>
<p><img alt="" src="https://pic.leetcode-cn.com/1626420025-fZfzMX-image.png" style="width: 302px; " /></p>
<pre>
<strong>输入:</strong>l1 = [7,2,4,3], l2 = [5,6,4]
<strong>输出:</strong>[7,8,0,7]
</pre>
<p><strong>示例2</strong></p>
<pre>
<strong>输入:</strong>l1 = [2,4,3], l2 = [5,6,4]
<strong>输出:</strong>[8,0,7]
</pre>
<p><strong>示例3</strong></p>
<pre>
<strong>输入:</strong>l1 = [0], l2 = [0]
<strong>输出:</strong>[0]
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li>链表的长度范围为<code> [1, 100]</code></li>
<li><code>0 &lt;= node.val &lt;= 9</code></li>
<li>输入数据保证链表代表的数字无前导 0</li>
</ul>
<p>&nbsp;</p>
<p><strong>进阶:</strong>如果输入链表不能翻转该如何解决?</p>