1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-07 00:11:41 +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>当一个字符串满足如下条件时,我们称它是 <b>美丽的</b> </p>\n\n<ul>\n\t<li>所有 5 个英文元音字母(<code>'a'</code> <code>'e'</code> <code>'i'</code> <code>'o'</code> <code>'u'</code>)都必须 <strong>至少</strong> 出现一次。</li>\n\t<li>这些元音字母的顺序都必须按照 <strong>字典序</strong> 升序排布(也就是说所有的 <code>'a'</code> 都在 <code>'e'</code> 前面,所有的 <code>'e'</code> 都在 <code>'i'</code> 前面,以此类推)</li>\n</ul>\n\n<p>比方说,字符串 <code>\"aeiou\"</code> 和 <code>\"aaaaaaeiiiioou\"</code> 都是 <strong>美丽的</strong> ,但是 <code>\"uaeio\"</code> <code>\"aeoiu\"</code> 和 <code>\"aaaeeeooo\"</code> <strong>不是美丽的</strong> 。</p>\n\n<p>给你一个只包含英文元音字母的字符串 <code>word</code> ,请你返回 <code>word</code> 中 <strong>最长美丽子字符串的长度</strong> 。如果不存在这样的子字符串,请返回 <code>0</code> 。</p>\n\n<p><strong>子字符串</strong> 是字符串中一个连续的字符序列。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<b>输入:</b>word = \"aeiaaio<strong>aaaaeiiiiouuu</strong>ooaauuaeiu\"\n<b>输出:</b>13\n<b>解释:</b>最长子字符串是 \"aaaaeiiiiouuu\" ,长度为 13 。</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<b>输入:</b>word = \"aeeeiiiioooauuu<strong>aeiou</strong>\"\n<b>输出:</b>5\n<b>解释:</b>最长子字符串是 \"aeiou\" ,长度为 5 。\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<b>输入:</b>word = \"a\"\n<b>输出:</b>0\n<b>解释:</b>没有美丽子字符串,所以返回 0 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= word.length <= 5 * 10<sup>5</sup></code></li>\n\t<li><code>word</code> 只包含字符 <code>'a'</code><code>'e'</code><code>'i'</code><code>'o'</code> 和 <code>'u'</code> 。</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 25,
"likes": 26,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"7.7K\", \"totalSubmission\": \"13.8K\", \"totalAcceptedRaw\": 7659, \"totalSubmissionRaw\": 13847, \"acRate\": \"55.3%\"}",
"stats": "{\"totalAccepted\": \"7.9K\", \"totalSubmission\": \"14.4K\", \"totalAcceptedRaw\": 7912, \"totalSubmissionRaw\": 14428, \"acRate\": \"54.8%\"}",
"hints": [
"Start from each 'a' and find the longest beautiful substring starting at that index.",
"Based on the current character decide if you should include the next character in the beautiful substring."