← 返回 amazon 的题目列表Add Two Numbers Represented by Linked Lists
类型:online_judge
amazon
Given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return a linked list. Example: Input: (2 -> 4 -> 3) + (5 -> 6 -> 4), Output: 7 -> 0 -> 8. Explanation: 342 + 465 = 807.
Example
Input
ListNode(2, ListNode(4, ListNode(3))), ListNode(5, ListNode(6, ListNode(4)))