Add two numbers represented by linked lists.
Asked in the Technical interview 1 stage. Pseudocode first, then code; optimal solution expected.
Implement add_two_numbers(l1, l2). Each linked list stores one digit per node in reverse order, so the head contains the units digit. Return the head of a new linked list representing the sum in the same format. Do not convert the lists into whole integers.
l1 and l2 are linked-list heads containing digits from 0 to 9. Return a linked-list head containing the sum.
def add_two_numbers(l1, l2):