# Author:   Jerry C. Wang <jcpwang@gmail.com>
# File:     AC_AddTwoNumbers.py

lass Solution(object):
    def addTwoNumbers(self, l1, l2):
        tmp = ListNode(0)
        head = tmp
        flag = 0

        while flag or l1 or l2:
            newNode = ListNode(flag)
            if l1:
                newNode.val += l1.val
                l1 = l1.next
            if l2:
                newNode.val += l2.val
                l2 = l2.next
            flag = newNode.val / 10
            newNode.val %= 10
            tmp.next = newNode
            tmp = tmp.next
        return head.next

Add Solution to Add Two Numbers
[Python] LeetCode: Add Solution to Add Two Numbers

Python Solution for 02 Add Two Numbers

[Link]: https://leetcode.com/problems/add-two-numbers
[Complexity]:

Signed-off-by: Jerry C Wang <398b9cc4b6d7225db629d423b2c3e64586a4df74@gmail.com>
