mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 22:13:28 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个字符串 <code>s</code> ,它只包含三种字符 a, b 和 c 。</p>\n\n<p>请你返回 a,b 和 c 都 <strong>至少 </strong>出现过一次的子字符串数目。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><strong>输入:</strong>s = "abcabc"\n<strong>输出:</strong>10\n<strong>解释:</strong>包含 a,b 和 c 各至少一次的子字符串为<em> "</em>abc<em>", "</em>abca<em>", "</em>abcab<em>", "</em>abcabc<em>", "</em>bca<em>", "</em>bcab<em>", "</em>bcabc<em>", "</em>cab<em>", "</em>cabc<em>" </em>和<em> "</em>abc<em>" </em>(<strong>相同</strong><strong>字符串算多次</strong>)<em>。</em>\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><strong>输入:</strong>s = "aaacb"\n<strong>输出:</strong>3\n<strong>解释:</strong>包含 a,b 和 c 各至少一次的子字符串为<em> "</em>aaacb<em>", "</em>aacb<em>" </em>和<em> "</em>acb<em>" 。</em>\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><strong>输入:</strong>s = "abc"\n<strong>输出:</strong>1\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>3 <= s.length <= 5 x 10^4</code></li>\n\t<li><code>s</code> 只包含字符 a,b 和 c 。</li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 70,
|
||||
"likes": 71,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -149,7 +149,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"7.2K\", \"totalSubmission\": \"14.2K\", \"totalAcceptedRaw\": 7183, \"totalSubmissionRaw\": 14196, \"acRate\": \"50.6%\"}",
|
||||
"stats": "{\"totalAccepted\": \"7.4K\", \"totalSubmission\": \"14.6K\", \"totalAcceptedRaw\": 7432, \"totalSubmissionRaw\": 14615, \"acRate\": \"50.9%\"}",
|
||||
"hints": [
|
||||
"For each position we simply need to find the first occurrence of a/b/c on or after this position.",
|
||||
"So we can pre-compute three link-list of indices of each a, b, and c."
|
||||
|
Reference in New Issue
Block a user