1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-04 23:11:41 +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>binary</code> ,它仅有 <code>0</code> 或者 <code>1</code> 组成。你可以使用下面的操作任意次对它进行修改:</p>\n\n<ul>\n\t<li>操作 1 :如果二进制串包含子字符串 <code>\"00\"</code> ,你可以用 <code>\"10\"</code> 将其替换。\n\n\t<ul>\n\t\t<li>比方说, <code>\"<strong>00</strong>010\" -> \"<strong>10</strong>010\"</code></li>\n\t</ul>\n\t</li>\n\t<li>操作 2 :如果二进制串包含子字符串 <code>\"10\"</code> ,你可以用 <code>\"01\"</code> 将其替换。\n\t<ul>\n\t\t<li>比方说, <code>\"000<strong>10</strong>\" -> \"000<strong>01</strong>\"</code></li>\n\t</ul>\n\t</li>\n</ul>\n\n<p>请你返回执行上述操作任意次以后能得到的 <strong>最大二进制字符串</strong> 。如果二进制字符串 <code>x</code> 对应的十进制数字大于二进制字符串 <code>y</code> 对应的十进制数字,那么我们称二进制字符串<em> </em><code>x</code><em> </em>大于二进制字符串<em> </em><code>y</code><em> </em>。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<b>输入:</b>binary = \"000110\"\n<b>输出:</b>\"111011\"\n<b>解释:</b>一个可行的转换为:\n\"0001<strong>10</strong>\" -> \"0001<strong>01</strong>\" \n\"<strong>00</strong>0101\" -> \"<strong>10</strong>0101\" \n\"1<strong>00</strong>101\" -> \"1<strong>10</strong>101\" \n\"110<strong>10</strong>1\" -> \"110<strong>01</strong>1\" \n\"11<strong>00</strong>11\" -> \"11<strong>10</strong>11\"\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<b>输入:</b>binary = \"01\"\n<b>输出:</b>\"01\"\n<b>解释:</b>\"01\" 没办法进行任何转换。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= binary.length <= 10<sup>5</sup></code></li>\n\t<li><code>binary</code> 仅包含 <code>'0'</code> 和 <code>'1'</code> 。</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 20,
"likes": 21,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"3.4K\", \"totalSubmission\": \"7.1K\", \"totalAcceptedRaw\": 3422, \"totalSubmissionRaw\": 7126, \"acRate\": \"48.0%\"}",
"stats": "{\"totalAccepted\": \"3.5K\", \"totalSubmission\": \"7.4K\", \"totalAcceptedRaw\": 3544, \"totalSubmissionRaw\": 7380, \"acRate\": \"48.0%\"}",
"hints": [
"Note that with the operations, you can always make the string only contain at most 1 zero."
],