mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 07:21:40 +08:00
update
This commit is contained in:
@@ -9,10 +9,10 @@
|
||||
"titleSlug": "goat-latin",
|
||||
"content": "<p>You are given a string <code>sentence</code> that consist of words separated by spaces. Each word consists of lowercase and uppercase letters only.</p>\n\n<p>We would like to convert the sentence to "Goat Latin" (a made-up language similar to Pig Latin.) The rules of Goat Latin are as follows:</p>\n\n<ul>\n\t<li>If a word begins with a vowel (<code>'a'</code>, <code>'e'</code>, <code>'i'</code>, <code>'o'</code>, or <code>'u'</code>), append <code>"ma"</code> to the end of the word.\n\n\t<ul>\n\t\t<li>For example, the word <code>"apple"</code> becomes <code>"applema"</code>.</li>\n\t</ul>\n\t</li>\n\t<li>If a word begins with a consonant (i.e., not a vowel), remove the first letter and append it to the end, then add <code>"ma"</code>.\n\t<ul>\n\t\t<li>For example, the word <code>"goat"</code> becomes <code>"oatgma"</code>.</li>\n\t</ul>\n\t</li>\n\t<li>Add one letter <code>'a'</code> to the end of each word per its word index in the sentence, starting with <code>1</code>.\n\t<ul>\n\t\t<li>For example, the first word gets <code>"a"</code> added to the end, the second word gets <code>"aa"</code> added to the end, and so on.</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>Return<em> the final sentence representing the conversion from sentence to Goat Latin</em>.</p>\n\n<p> </p>\n<p><strong>Example 1:</strong></p>\n<pre><strong>Input:</strong> sentence = \"I speak Goat Latin\"\n<strong>Output:</strong> \"Imaa peaksmaaa oatGmaaaa atinLmaaaaa\"\n</pre><p><strong>Example 2:</strong></p>\n<pre><strong>Input:</strong> sentence = \"The quick brown fox jumped over the lazy dog\"\n<strong>Output:</strong> \"heTmaa uickqmaaa rownbmaaaa oxfmaaaaa umpedjmaaaaaa overmaaaaaaa hetmaaaaaaaa azylmaaaaaaaaa ogdmaaaaaaaaaa\"\n</pre>\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= sentence.length <= 150</code></li>\n\t<li><code>sentence</code> consists of English letters and spaces.</li>\n\t<li><code>sentence</code> has no leading or trailing spaces.</li>\n\t<li>All the words in <code>sentence</code> are separated by a single space.</li>\n</ul>\n",
|
||||
"translatedTitle": "山羊拉丁文",
|
||||
"translatedContent": "<p>给定一个由空格分割单词的句子 <code>S</code>。每个单词只包含大写或小写字母。</p>\n\n<p>我们要将句子转换为 <em>“Goat Latin”</em>(一种类似于 猪拉丁文 - Pig Latin 的虚构语言)。</p>\n\n<p>山羊拉丁文的规则如下:</p>\n\n<ul>\n\t<li>如果单词以元音开头(a, e, i, o, u),在单词后添加<code>"ma"</code>。<br />\n\t例如,单词<code>"apple"</code>变为<code>"applema"</code>。</li>\n\t<br />\n\t<li>如果单词以辅音字母开头(即非元音字母),移除第一个字符并将它放到末尾,之后再添加<code>"ma"</code>。<br />\n\t例如,单词<code>"goat"</code>变为<code>"oatgma"</code>。</li>\n\t<br />\n\t<li>根据单词在句子中的索引,在单词最后添加与索引相同数量的字母<code>'a'</code>,索引从1开始。<br />\n\t例如,在第一个单词后添加<code>"a"</code>,在第二个单词后添加<code>"aa"</code>,以此类推。</li>\n</ul>\n\n<p>返回将 <code>S</code> 转换为山羊拉丁文后的句子。</p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入: </strong>"I speak Goat Latin"\n<strong>输出: </strong>"Imaa peaksmaaa oatGmaaaa atinLmaaaaa"\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入: </strong>"The quick brown fox jumped over the lazy dog"\n<strong>输出: </strong>"heTmaa uickqmaaa rownbmaaaa oxfmaaaaa umpedjmaaaaaa overmaaaaaaa hetmaaaaaaaa azylmaaaaaaaaa ogdmaaaaaaaaaa"\n</pre>\n\n<p><strong>说明:</strong></p>\n\n<ul>\n\t<li><code>S</code> 中仅包含大小写字母和空格。单词间有且仅有一个空格。</li>\n\t<li><code>1 <= S.length <= 150</code>。</li>\n</ul>\n",
|
||||
"translatedContent": "<p>给你一个由若干单词组成的句子 <code>sentence</code> ,单词间由空格分隔。每个单词仅由大写和小写英文字母组成。</p>\n\n<p>请你将句子转换为 <em>“</em>山羊拉丁文(<em>Goat Latin</em>)<em>”</em>(一种类似于 猪拉丁文 - Pig Latin 的虚构语言)。山羊拉丁文的规则如下:</p>\n\n<ul>\n\t<li>如果单词以元音开头(<code>'a'</code>, <code>'e'</code>, <code>'i'</code>, <code>'o'</code>, <code>'u'</code>),在单词后添加<code>\"ma\"</code>。\n\n\t<ul>\n\t\t<li>例如,单词 <code>\"apple\"</code> 变为 <code>\"applema\"</code> 。</li>\n\t</ul>\n\t</li>\n\t<li>如果单词以辅音字母开头(即,非元音字母),移除第一个字符并将它放到末尾,之后再添加<code>\"ma\"</code>。\n\t<ul>\n\t\t<li>例如,单词 <code>\"goat\"</code> 变为 <code>\"oatgma\"</code> 。</li>\n\t</ul>\n\t</li>\n\t<li>根据单词在句子中的索引,在单词最后添加与索引相同数量的字母<code>'a'</code>,索引从 <code>1</code> 开始。\n\t<ul>\n\t\t<li>例如,在第一个单词后添加 <code>\"a\"</code> ,在第二个单词后添加 <code>\"aa\"</code> ,以此类推。</li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>返回将 <code>sentence</code> 转换为山羊拉丁文后的句子。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>sentence = \"I speak Goat Latin\"\n<strong>输出:</strong>\"Imaa peaksmaaa oatGmaaaa atinLmaaaaa\"\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>sentence = \"The quick brown fox jumped over the lazy dog\"\n<strong>输出:</strong>\"heTmaa uickqmaaa rownbmaaaa oxfmaaaaa umpedjmaaaaaa overmaaaaaaa hetmaaaaaaaa azylmaaaaaaaaa ogdmaaaaaaaaaa\"\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= sentence.length <= 150</code></li>\n\t<li><code>sentence</code> 由英文字母和空格组成</li>\n\t<li><code>sentence</code> 不含前导或尾随空格</li>\n\t<li><code>sentence</code> 中的所有单词由单个空格分隔</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Easy",
|
||||
"likes": 59,
|
||||
"likes": 121,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -137,7 +137,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"19.1K\", \"totalSubmission\": \"30.8K\", \"totalAcceptedRaw\": 19088, \"totalSubmissionRaw\": 30836, \"acRate\": \"61.9%\"}",
|
||||
"stats": "{\"totalAccepted\": \"49.8K\", \"totalSubmission\": \"76.2K\", \"totalAcceptedRaw\": 49827, \"totalSubmissionRaw\": 76216, \"acRate\": \"65.4%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user