1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-12-18 10:04:58 +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>给你一个字符串&nbsp;<code>title</code>&nbsp;,它由单个空格连接一个或多个单词组成,每个单词都只包含英文字母。请你按以下规则将每个单词的首字母 <strong>大写</strong>&nbsp;</p>\n\n<ul>\n\t<li>如果单词的长度为&nbsp;<code>1</code>&nbsp;或者&nbsp;<code>2</code>&nbsp;,所有字母变成小写。</li>\n\t<li>否则,将单词首字母大写,剩余字母变成小写。</li>\n</ul>\n\n<p>请你返回 <strong>大写后</strong>&nbsp;的<em>&nbsp;</em><code>title</code>&nbsp;。</p>\n\n<p>&nbsp;</p>\n\n<p><b>示例 1</b></p>\n\n<pre><b>输入:</b>title = \"capiTalIze tHe titLe\"\n<b>输出:</b>\"Capitalize The Title\"\n<strong>解释:</strong>\n由于所有单词的长度都至少为 3 ,将每个单词首字母大写,剩余字母变为小写。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><b>输入:</b>title = \"First leTTeR of EACH Word\"\n<b>输出:</b>\"First Letter of Each Word\"\n<strong>解释:</strong>\n单词 \"of\" 长度为 2 ,所以它保持完全小写。\n其他单词长度都至少为 3 ,所以其他单词首字母大写,剩余字母小写。\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre><b>输入:</b>title = \"i lOve leetcode\"\n<b>输出:</b>\"i Love Leetcode\"\n<strong>解释:</strong>\n单词 \"i\" 长度为 1 ,所以它保留小写。\n其他单词长度都至少为 3 ,所以其他单词首字母大写,剩余字母小写。\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= title.length &lt;= 100</code></li>\n\t<li><code>title</code>&nbsp;由单个空格隔开的单词组成,且不含有任何前导或后缀空格。</li>\n\t<li>每个单词由大写和小写英文字母组成,且都是 <strong>非空</strong>&nbsp;的。</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Easy",
"likes": 5,
"likes": 6,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -137,7 +137,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"5.2K\", \"totalSubmission\": \"8.4K\", \"totalAcceptedRaw\": 5167, \"totalSubmissionRaw\": 8364, \"acRate\": \"61.8%\"}",
"stats": "{\"totalAccepted\": \"5.5K\", \"totalSubmission\": \"8.9K\", \"totalAcceptedRaw\": 5499, \"totalSubmissionRaw\": 8924, \"acRate\": \"61.6%\"}",
"hints": [
"Firstly, try to find all the words present in the string.",
"On the basis of each word's lengths, simulate the process explained in Problem."