1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-22 21:46:46 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-05-02 23:44:12 +08:00
parent 7ea03594b3
commit 2a71c78585
4790 changed files with 11696 additions and 10944 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你两个 <strong>非空</strong> 的链表,表示两个非负的整数。它们每位数字都是按照 <strong>逆序</strong> 的方式存储的,并且每个节点只能存储 <strong>一位</strong> 数字。</p>\n\n<p>请你将两个数相加,并以相同形式返回一个表示和的链表。</p>\n\n<p>你可以假设除了数字 0 之外,这两个数都不会以 0 开头。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n<img alt=\"\" src=\"https://assets.leetcode-cn.com/aliyun-lc-upload/uploads/2021/01/02/addtwonumber1.jpg\" style=\"width: 483px; height: 342px;\" />\n<pre>\n<strong>输入:</strong>l1 = [2,4,3], l2 = [5,6,4]\n<strong>输出:</strong>[7,0,8]\n<strong>解释:</strong>342 + 465 = 807.\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>l1 = [0], l2 = [0]\n<strong>输出:</strong>[0]\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>l1 = [9,9,9,9,9,9,9], l2 = [9,9,9,9]\n<strong>输出:</strong>[8,9,9,9,0,0,0,1]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li>每个链表中的节点数在范围 <code>[1, 100]</code> 内</li>\n\t<li><code>0 <= Node.val <= 9</code></li>\n\t<li>题目数据保证列表表示的数字不含前导零</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 7784,
"likes": 7952,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Multiply Strings\", \"titleSlug\": \"multiply-strings\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u5b57\\u7b26\\u4e32\\u76f8\\u4e58\"}, {\"title\": \"Add Binary\", \"titleSlug\": \"add-binary\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u4e8c\\u8fdb\\u5236\\u6c42\\u548c\"}, {\"title\": \"Sum of Two Integers\", \"titleSlug\": \"sum-of-two-integers\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u4e24\\u6574\\u6570\\u4e4b\\u548c\"}, {\"title\": \"Add Strings\", \"titleSlug\": \"add-strings\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u5b57\\u7b26\\u4e32\\u76f8\\u52a0\"}, {\"title\": \"Add Two Numbers II\", \"titleSlug\": \"add-two-numbers-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u4e24\\u6570\\u76f8\\u52a0 II\"}, {\"title\": \"Add to Array-Form of Integer\", \"titleSlug\": \"add-to-array-form-of-integer\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u6570\\u7ec4\\u5f62\\u5f0f\\u7684\\u6574\\u6570\\u52a0\\u6cd5\"}]",
@@ -55,13 +55,13 @@
{
"lang": "Python",
"langSlug": "python",
"code": "# Definition for singly-linked list.\n# class ListNode(object):\n# def __init__(self, val=0, next=None):\n# self.val = val\n# self.next = next\nclass Solution(object):\n def addTwoNumbers(self, l1, l2):\n \"\"\"\n :type l1: ListNode\n :type l2: ListNode\n :rtype: ListNode\n \"\"\"",
"code": "# Definition for singly-linked list.\n# class ListNode(object):\n# def __init__(self, val=0, next=None):\n# self.val = val\n# self.next = next\nclass Solution(object):\n def addTwoNumbers(self, l1, l2):\n \"\"\"\n :type l1: ListNode\n :type l2: ListNode\n :rtype: ListNode\n \"\"\"\n ",
"__typename": "CodeSnippetNode"
},
{
"lang": "Python3",
"langSlug": "python3",
"code": "# Definition for singly-linked list.\n# class ListNode:\n# def __init__(self, val=0, next=None):\n# self.val = val\n# self.next = next\nclass Solution:\n def addTwoNumbers(self, l1: ListNode, l2: ListNode) -> ListNode:",
"code": "# Definition for singly-linked list.\n# class ListNode:\n# def __init__(self, val=0, next=None):\n# self.val = val\n# self.next = next\nclass Solution:\n def addTwoNumbers(self, l1: Optional[ListNode], l2: Optional[ListNode]) -> Optional[ListNode]:",
"__typename": "CodeSnippetNode"
},
{
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"1.3M\", \"totalSubmission\": \"3M\", \"totalAcceptedRaw\": 1254282, \"totalSubmissionRaw\": 3022687, \"acRate\": \"41.5%\"}",
"stats": "{\"totalAccepted\": \"1.3M\", \"totalSubmission\": \"3.1M\", \"totalAcceptedRaw\": 1303602, \"totalSubmissionRaw\": 3131770, \"acRate\": \"41.6%\"}",
"hints": [],
"solution": {
"id": "5",