You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order (each node contains a single digit). Add the two numbers and return the sum as a linked list. Example: Input: l1 = [2,4,3], l2 = [5,6,4] Output: [7,0,8] Explanation: 342 + 465 = 807, returned as [7,0,8]. Pattern focus: Dummy Head Node (for result list).
l1 = ListNode, l2 = ListNode
return ListNode
Example 1:
Input:
l1 = [2,4,3] l2 = [5,6,4]
Output:
[7,0,8]
Explanation:
342 + 465 = 807, represented as [7,0,8].
Example 2:
Input:
l1 = [0] l2 = [0]
Output:
[0]
Explanation:
0 + 0 = 0.