mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-06 07:51:41 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个字符串 <code>s</code> ,请你反转字符串中 <strong>单词</strong> 的顺序。</p>\n\n<p><strong>单词</strong> 是由非空格字符组成的字符串。<code>s</code> 中使用至少一个空格将字符串中的 <strong>单词</strong> 分隔开。</p>\n\n<p>返回 <strong>单词</strong> 顺序颠倒且 <strong>单词</strong> 之间用单个空格连接的结果字符串。</p>\n\n<p><strong>注意:</strong>输入字符串 <code>s</code>中可能会存在前导空格、尾随空格或者单词间的多个空格。返回的结果字符串中,单词间应当仅用单个空格分隔,且不包含任何额外的空格。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"<code>the sky is blue</code>\"\n<strong>输出:</strong>\"<code>blue is sky the</code>\"\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \" hello world \"\n<strong>输出:</strong>\"world hello\"\n<strong>解释:</strong>反转后的字符串中不能存在前导空格和尾随空格。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"a good example\"\n<strong>输出:</strong>\"example good a\"\n<strong>解释:</strong>如果两个单词间有多余的空格,反转后的字符串需要将单词间的空格减少到仅有一个。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 10<sup>4</sup></code></li>\n\t<li><code>s</code> 包含英文大小写字母、数字和空格 <code>' '</code></li>\n\t<li><code>s</code> 中 <strong>至少存在一个</strong> 单词</li>\n</ul>\n\n<ul>\n</ul>\n\n<p> </p>\n\n<p><strong>进阶:</strong>如果字符串在你使用的编程语言中是一种可变数据类型,请尝试使用 <code>O(1)</code> 额外空间复杂度的 <strong>原地</strong> 解法。</p>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 1077,
|
||||
"likes": 1078,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[{\"title\": \"Reverse Words in a String II\", \"titleSlug\": \"reverse-words-in-a-string-ii\", \"difficulty\": \"Medium\", \"translatedTitle\": \"\\u53cd\\u8f6c\\u5b57\\u7b26\\u4e32\\u4e2d\\u7684\\u5355\\u8bcd II\", \"isPaidOnly\": true}]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"482.8K\", \"totalSubmission\": \"904.1K\", \"totalAcceptedRaw\": 482836, \"totalSubmissionRaw\": 904074, \"acRate\": \"53.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"482.9K\", \"totalSubmission\": \"904.3K\", \"totalAcceptedRaw\": 482946, \"totalSubmissionRaw\": 904271, \"acRate\": \"53.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user