2. Add Two Numbers
Practice Add Two Numbers for free on NudgeCode: Medium, Linked List pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
Two non-negative integers are stored as linked lists, one digit per node, with the least significant digit first. Add the two numbers and return the sum as a linked list in the same format. Neither input has leading zeros, except the number 0 itself.
Example
l1 = [2,4,3], l2 = [5,6,4] -> [7,0,8] (342 + 465 = 807)
Constraints
- 1 <= length of each list <= 100
- 0 <= Node.val <= 9