一看就懂
class Solution:
def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:
num1 = num2 = 0
head = l1
t = 1
while head:
num1 += head.val*t
t *= 10
head = head.next
head = l2
t = 1
while head:
num1 += head.val*t
t *= 10
head = head.next
t = num1 + num2
node = ListNode(t%10)
head = node
t = t//10
while t:
head.next = ListNode(t%10)
t = t//10
head = head.next
return node