Add Two Numbers
You are given two linked lists representing two non-negative numbers. 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.
Input: (2 -> 4 -> 3) + (5 -> 6 -> 4)
Output: 7 -> 0 -> 8
思路:本题的关键在于各种边界的考虑,
1两个链表有一个为空
2两个链表长度不等
3两个链表最好一位相加有进位.
这题只要考虑到上述三种边界情况,代码就非常简单了,就不贴代码了,希望原谅