445. Add Two Numbers II

Practice Add Two Numbers II 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 most significant digit first. Add the two numbers and return the sum as a new linked list in the same format. Neither input has leading zeros, except the number 0 itself.

Example

l1 = [7,2,4,3], l2 = [5,6,4]  ->  [7,8,0,7]   (7243 + 564 = 7807)

Constraints