@@ -0,0 +1,892 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A# author: latios%0A%0A%22%22%22%0AReference:%0A    https://discuss.leetcode.com/topic/8909/clear-python-code-straight-forward%0A%22%22%22%0A%0A# Definition for singly-linked list.%0Aclass ListNode(object):%0A    def __init__(self, x):%0A        self.val = x%0A        self.next = None%0A%0A%0Aclass Solution(object):%0A    def addTwoNumbers(self, l1, l2):%0A        %22%22%22%0A        :type l1: ListNode%0A        :type l2: ListNode%0A        :rtype: ListNode%0A        %22%22%22%0A        root = ListNode(0)%0A        curr = root%0A        carry = 0%0A        while l1 or l2 or carry:%0A            v1 = v2 = 0%0A            if l1:%0A                v1 = l1.val%0A                l1 = l1.next%0A            if l2:%0A                v2 = l2.val%0A                l2 = l2.next%0A            v = v1 + v2 + carry%0A            carry, v = divmod(v, 10)%0A            curr.next = ListNode(v)%0A            curr = curr.next%0A        return root.next%0A

improve 2