1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-12-19 02:24:59 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
This commit is contained in:
2022-03-29 16:56:27 +08:00
parent e730aa6794
commit ad15da05aa
2517 changed files with 7358 additions and 7332 deletions

View File

@@ -12,7 +12,7 @@
"translatedContent": "<p>给你两个字符串 <code>s</code> 和 <code>part</code> ,请你对 <code>s</code> 反复执行以下操作直到 <b>所有</b> 子字符串 <code>part</code> 都被删除:</p>\n\n<ul>\n\t<li>找到 <code>s</code> 中 <strong>最左边</strong> 的子字符串 <code>part</code> ,并将它从 <code>s</code> 中删除。</li>\n</ul>\n\n<p>请你返回从 <code>s</code> 中删除所有 <code>part</code> 子字符串以后得到的剩余字符串。</p>\n\n<p>一个 <strong>子字符串</strong> 是一个字符串中连续的字符序列。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><b>输入:</b>s = \"daabcbaabcbc\", part = \"abc\"\n<b>输出:</b>\"dab\"\n<b>解释:</b>以下操作按顺序执行:\n- s = \"da<strong>abc</strong>baabcbc\" ,删除下标从 2 开始的 \"abc\" ,得到 s = \"dabaabcbc\" 。\n- s = \"daba<strong>abc</strong>bc\" ,删除下标从 4 开始的 \"abc\" ,得到 s = \"dababc\" 。\n- s = \"dab<strong>abc</strong>\" ,删除下标从 3 开始的 \"abc\" ,得到 s = \"dab\" 。\n此时 s 中不再含有子字符串 \"abc\" 。\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><b>输入:</b>s = \"axxxxyyyyb\", part = \"xy\"\n<b>输出:</b>\"ab\"\n<b>解释:</b>以下操作按顺序执行:\n- s = \"axxx<strong>xy</strong>yyyb\" ,删除下标从 4 开始的 \"xy\" ,得到 s = \"axxxyyyb\" 。\n- s = \"axx<strong>xy</strong>yyb\" ,删除下标从 3 开始的 \"xy\" ,得到 s = \"axxyyb\" 。\n- s = \"ax<strong>xy</strong>yb\" ,删除下标从 2 开始的 \"xy\" ,得到 s = \"axyb\" 。\n- s = \"a<strong>xy</strong>b\" ,删除下标从 1 开始的 \"xy\" ,得到 s = \"ab\" 。\n此时 s 中不再含有子字符串 \"xy\" 。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= s.length &lt;= 1000</code></li>\n\t<li><code>1 &lt;= part.length &lt;= 1000</code></li>\n\t<li><code>s</code> 和 <code>part</code> 只包小写英文字母。</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 16,
"likes": 17,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -137,7 +137,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"4.6K\", \"totalSubmission\": \"6.9K\", \"totalAcceptedRaw\": 4590, \"totalSubmissionRaw\": 6866, \"acRate\": \"66.9%\"}",
"stats": "{\"totalAccepted\": \"4.6K\", \"totalSubmission\": \"6.9K\", \"totalAcceptedRaw\": 4602, \"totalSubmissionRaw\": 6883, \"acRate\": \"66.9%\"}",
"hints": [
"Note that a new occurrence of pattern can appear if you remove an old one, For example, s = \"ababcc\" and pattern = \"abc\".",
"You can maintain a stack of characters and if the last character of the pattern size in the stack match the pattern remove them"