1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-22 13:36:46 +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> ,删除最小数量的无效括号,使得输入的字符串有效。</p>\n\n<p>返回所有可能的结果。答案可以按 <strong>任意顺序</strong> 返回。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"()())()\"\n<strong>输出:</strong>[\"(())()\",\"()()()\"]\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"(a)())()\"\n<strong>输出:</strong>[\"(a())()\",\"(a)()()\"]\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \")(\"\n<strong>输出:</strong>[\"\"]\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 25</code></li>\n\t<li><code>s</code> 由小写英文字母以及括号 <code>'('</code> 和 <code>')'</code> 组成</li>\n\t<li><code>s</code> 中至多含 <code>20</code> 个括号</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Hard",
"likes": 696,
"likes": 714,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[{\"title\": \"Valid Parentheses\", \"titleSlug\": \"valid-parentheses\", \"difficulty\": \"Easy\", \"translatedTitle\": \"\\u6709\\u6548\\u7684\\u62ec\\u53f7\"}]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"63.2K\", \"totalSubmission\": \"115.1K\", \"totalAcceptedRaw\": 63222, \"totalSubmissionRaw\": 115070, \"acRate\": \"54.9%\"}",
"stats": "{\"totalAccepted\": \"66.4K\", \"totalSubmission\": \"120.6K\", \"totalAcceptedRaw\": 66352, \"totalSubmissionRaw\": 120585, \"acRate\": \"55.0%\"}",
"hints": [
"Since we don't know which of the brackets can possibly be removed, we try out all the options!",
"We can use recursion to try out all possibilities for the given expression. For each of the brackets, we have 2 options:\r\n\r\n<ol>\r\n<li> We keep the bracket and add it to the expression that we are building on the fly during recursion.</li>\r\n<li> OR, we can discard the bracket and move on.\r\n</ol>",