1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 22:13:28 +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>s</code>&nbsp;,它只包含三种字符 a, b 和 c 。</p>\n\n<p>请你返回 ab 和 c 都&nbsp;<strong>至少&nbsp;</strong>出现过一次的子字符串数目。</p>\n\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><strong>输入:</strong>s = &quot;abcabc&quot;\n<strong>输出:</strong>10\n<strong>解释:</strong>包含 ab 和 c 各至少一次的子字符串为<em> &quot;</em>abc<em>&quot;, &quot;</em>abca<em>&quot;, &quot;</em>abcab<em>&quot;, &quot;</em>abcabc<em>&quot;, &quot;</em>bca<em>&quot;, &quot;</em>bcab<em>&quot;, &quot;</em>bcabc<em>&quot;, &quot;</em>cab<em>&quot;, &quot;</em>cabc<em>&quot; </em>和<em> &quot;</em>abc<em>&quot; </em>(<strong>相同</strong><strong>字符串算多次</strong>)<em>。</em>\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><strong>输入:</strong>s = &quot;aaacb&quot;\n<strong>输出:</strong>3\n<strong>解释:</strong>包含 ab 和 c 各至少一次的子字符串为<em> &quot;</em>aaacb<em>&quot;, &quot;</em>aacb<em>&quot; </em>和<em> &quot;</em>acb<em>&quot; 。</em>\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre><strong>输入:</strong>s = &quot;abc&quot;\n<strong>输出:</strong>1\n</pre>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>3 &lt;= s.length &lt;= 5 x 10^4</code></li>\n\t<li><code>s</code>&nbsp;只包含字符 ab 和 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."