Your question is Add Two Numbers in a Linked List. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Ciena network software may represent large numeric counters as digit-by-digit linked structures. Given two non-empty linked lists, add the numbers they represent and return the result as a linked list.
Each list stores digits in reverse order: the head contains the ones digit, and each following node contains the next digit. Each node contains one digit from 0 through 9. The result must use the same reverse-order representation. Create a new node for every result digit, and preserve a final carry when one remains.
The platform provides a ListNode class with val and next fields. The function receives the heads of the two lists and returns the head of a newly constructed result list.
def add_two_numbers(l1, l2):