欢迎24级新生

2063. LeetCode Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 itself.

输入

Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)

输出

Output: 7 -> 0 -> 8

样例

标准输入 复制文本
(9->9->9->9->9)+(1->)
标准输出 复制文本
(0->0->0->0->0->1)

提示

2 个逆序的链表,要求从低位开始相加,得出结果也逆序输出,返回值是逆序结果链表的头结点。

登录以提交代码。
单点时限 1 秒
内存限制 128 MB
提交 0
通过 0