1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 14:12:17 +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>给你一个整数 <code>n</code>,请返回长度为 <code>n</code> 、仅由元音 (<code>a</code>, <code>e</code>, <code>i</code>, <code>o</code>, <code>u</code>) 组成且按 <strong>字典序排列</strong> 的字符串数量。</p>\n\n<p>字符串 <code>s</code> 按 <strong>字典序排列</strong> 需要满足:对于所有有效的 <code>i</code><code>s[i]</code> 在字母表中的位置总是与 <code>s[i+1]</code> 相同或在 <code>s[i+1]</code> 之前。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 1\n<strong>输出:</strong>5\n<strong>解释:</strong>仅由元音组成的 5 个字典序字符串为 <code>[\"a\",\"e\",\"i\",\"o\",\"u\"]</code>\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 2\n<strong>输出:</strong>15\n<strong>解释:</strong>仅由元音组成的 15 个字典序字符串为\n[\"aa\",\"ae\",\"ai\",\"ao\",\"au\",\"ee\",\"ei\",\"eo\",\"eu\",\"ii\",\"io\",\"iu\",\"oo\",\"ou\",\"uu\"]\n注意\"ea\" 不是符合题意的字符串,因为 'e' 在字母表中的位置比 'a' 靠后\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 33\n<strong>输出:</strong>66045\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= n <= 50</code> </li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 65,
"likes": 66,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -137,7 +137,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"13.2K\", \"totalSubmission\": \"17K\", \"totalAcceptedRaw\": 13174, \"totalSubmissionRaw\": 17030, \"acRate\": \"77.4%\"}",
"stats": "{\"totalAccepted\": \"13.4K\", \"totalSubmission\": \"17.3K\", \"totalAcceptedRaw\": 13391, \"totalSubmissionRaw\": 17296, \"acRate\": \"77.4%\"}",
"hints": [
"For each character, its possible values will depend on the value of its previous character, because it needs to be not smaller than it.",
"Think backtracking. Build a recursive function count(n, last_character) that counts the number of valid strings of length n and whose first characters are not less than last_character.",