class Solution:
def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:
if l1 == None: return l2
if l2 == None: return l1
head = point = ListNode()
flag = 0
while l1 and l2:
new = (l1.val + l2.val + flag) % 10
flag = (l1.val + l2.val + flag) // 10
point.next = ListNode(new)
point = point.next
if l1.next and l2.next:
l1 = l1.next
l2 = l2.next
elif l2.next and (l1.next is None):
l1.next = ListNode(0)
l1 = l1.next
l2 = l2.next
elif l1.next and (l2.next is None):
l2.next = ListNode(0)
l2 = l2.next
l1 = l1.next
else:
break
if flag == 1: point.next = ListNode(1)
return head.next
point = ListNode()
while **:
new = 0
point.next = ListNode(new)
point = point.next
new = num % 10
flag = num // 10