mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 22:13:28 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给定单链表的头节点 <code>head</code> ,将所有索引为奇数的节点和索引为偶数的节点分别组合在一起,然后返回重新排序的列表。</p>\n\n<p><strong>第一个</strong>节点的索引被认为是 <strong>奇数</strong> , <strong>第二个</strong>节点的索引为 <strong>偶数</strong> ,以此类推。</p>\n\n<p>请注意,偶数组和奇数组内部的相对顺序应该与输入时保持一致。</p>\n\n<p>你必须在 <code>O(1)</code> 的额外空间复杂度和 <code>O(n)</code> 的时间复杂度下解决这个问题。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/03/10/oddeven-linked-list.jpg\" style=\"height: 123px; width: 300px;\" /></p>\n\n<pre>\n<strong>输入: </strong>head = [1,2,3,4,5]\n<strong>输出:</strong> [1,3,5,2,4]</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<p><img src=\"https://assets.leetcode.com/uploads/2021/03/10/oddeven2-linked-list.jpg\" style=\"height: 142px; width: 500px;\" /></p>\n\n<pre>\n<strong>输入:</strong> head = [2,1,3,5,6,4,7]\n<strong>输出:</strong> [2,3,6,7,1,5,4]</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>n == </code> 链表中的节点数</li>\n\t<li><code>0 <= n <= 10<sup>4</sup></code></li>\n\t<li><code>-10<sup>6</sup> <= Node.val <= 10<sup>6</sup></code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 557,
|
||||
"likes": 576,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Split Linked List in Parts\", \"titleSlug\": \"split-linked-list-in-parts\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u5206\\u9694\\u94fe\\u8868\"}]",
|
||||
@@ -137,7 +137,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"151.8K\", \"totalSubmission\": \"232.1K\", \"totalAcceptedRaw\": 151807, \"totalSubmissionRaw\": 232147, \"acRate\": \"65.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"156.4K\", \"totalSubmission\": \"239.3K\", \"totalAcceptedRaw\": 156437, \"totalSubmissionRaw\": 239279, \"acRate\": \"65.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user