You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each node contains a single digit. Add the two numbers and return the sum as a linked list in the same reverse-digit format. For example, l1 = [2,4,3] represents the number 342, and l2 = [5,6,4] represents the number 465. Their sum is 342 + 465 = 807, which is represented as [7,0,8]. You may assume the two numbers do not contain any leading zeros, except the number 0 itself.
Example 1
Input: l1 = [2,4,3], l2 = [5,6,4]
Output: [7,0,8]
Explanation: The lists store the digits in reverse, so they represent 342 and 465. 342 + 465 = 807, which in reverse order is [7,0,8].
Example 2
Input: l1 = [0], l2 = [0]
Output: [0]
Explanation: Both lists represent 0, and 0 + 0 = 0, so the result is [0].
Example 3
Input: l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9]
Output: [8,9,9,9,0,0,0,1]
Explanation: The lists represent 9999999 and 9999. Their sum is 10009998, which in reverse-digit order is [8,9,9,9,0,0,0,1]. The final carry creates an extra node.
Walk both lists simultaneously, adding corresponding digits plus any carry from the previous step, just like pencil-and-paper addition.
Run checks all cases above. Submit evaluates all test cases.