mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-03 06:22:54 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>如果某个字符串中 <strong>至多一个</strong> 字母出现 <strong>奇数</strong> 次,则称其为 <strong>最美</strong> 字符串。</p>\n\n<ul>\n\t<li>例如,<code>\"ccjjc\"</code> 和 <code>\"abab\"</code> 都是最美字符串,但 <code>\"ab\"</code> 不是。</li>\n</ul>\n\n<p>给你一个字符串 <code>word</code> ,该字符串由前十个小写英文字母组成(<code>'a'</code> 到 <code>'j'</code>)。请你返回 <code>word</code> 中 <strong>最美非空子字符串</strong> 的数目<em>。</em>如果同样的子字符串在<em> </em><code>word</code> 中出现多次,那么应当对 <strong>每次出现</strong> 分别计数<em>。</em></p>\n\n<p><strong>子字符串</strong> 是字符串中的一个连续字符序列。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>word = \"aba\"\n<strong>输出:</strong>4\n<strong>解释:</strong>4 个最美子字符串如下所示:\n- \"<strong>a</strong>ba\" -> \"a\"\n- \"a<strong>b</strong>a\" -> \"b\"\n- \"ab<strong>a</strong>\" -> \"a\"\n- \"<strong>aba</strong>\" -> \"aba\"\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>word = \"aabb\"\n<strong>输出:</strong>9\n<strong>解释:</strong>9 个最美子字符串如下所示:\n- \"<strong>a</strong>abb\" -> \"a\"\n- \"<strong>aa</strong>bb\" -> \"aa\"\n- \"<strong>aab</strong>b\" -> \"aab\"\n- \"<strong>aabb</strong>\" -> \"aabb\"\n- \"a<strong>a</strong>bb\" -> \"a\"\n- \"a<strong>abb</strong>\" -> \"abb\"\n- \"aa<strong>b</strong>b\" -> \"b\"\n- \"aa<strong>bb</strong>\" -> \"bb\"\n- \"aab<strong>b</strong>\" -> \"b\"\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>word = \"he\"\n<strong>输出:</strong>2\n<strong>解释:</strong>2 个最美子字符串如下所示:\n- \"<b>h</b>e\" -> \"h\"\n- \"h<strong>e</strong>\" -> \"e\"\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= word.length <= 10<sup>5</sup></code></li>\n\t<li><code>word</code> 由从 <code>'a'</code> 到 <code>'j'</code> 的小写英文字母组成</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 65,
|
||||
"likes": 69,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -155,7 +155,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"3.3K\", \"totalSubmission\": \"8.1K\", \"totalAcceptedRaw\": 3267, \"totalSubmissionRaw\": 8125, \"acRate\": \"40.2%\"}",
|
||||
"stats": "{\"totalAccepted\": \"3.3K\", \"totalSubmission\": \"8.3K\", \"totalAcceptedRaw\": 3333, \"totalSubmissionRaw\": 8269, \"acRate\": \"40.3%\"}",
|
||||
"hints": [
|
||||
"For each prefix of the string, check which characters are of even frequency and which are not and represent it by a bitmask.",
|
||||
"Find the other prefixes whose masks differs from the current prefix mask by at most one bit."
|
||||
|
Reference in New Issue
Block a user