@@ -0,0 +1,989 @@
+# Definition for singly-linked list.%0A# class ListNode:%0A#     def __init__(self, x):%0A#         self.val = x%0A#         self.next = None%0A%0Aclass Solution:%0A    # @param l1: the first list%0A    # @param l2: the second list%0A    # @return: the sum list of l1 and l2 %0A    def addLists(self, l1, l2):%0A        # write your code here%0A        if l1 == None: return l2%0A        if l2 == None: return l1%0A        flag = 0%0A        dummy = ListNode(0); p = dummy%0A        while l1 and l2:%0A            p.next = ListNode((l1.val+l2.val+flag) %25 10)%0A            flag = (l1.val+l2.val+flag) / 10%0A            l1 = l1.next; l2 = l2.next; p = p.next%0A        while l2:%0A            p.next = ListNode((l2.val+flag) %25 10)%0A            flag = (l2.val+flag) / 10%0A            l2 = l2.next; p = p.next%0A        while l1:%0A            p.next = ListNode((l1.val+flag) %25 10)%0A            flag = (l1.val+flag) / 10%0A            l1 = l1.next; p = p.next%0A            %0A        if flag == 1: p.next = ListNode(1)%0A        return dummy.next%0A

Create Add2Nums_001.py