mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-02 22:13:28 +08:00
update
This commit is contained in:
@@ -9,10 +9,10 @@
|
||||
"titleSlug": "flip-string-to-monotone-increasing",
|
||||
"content": "<p>A binary string is monotone increasing if it consists of some number of <code>0</code>'s (possibly none), followed by some number of <code>1</code>'s (also possibly none).</p>\n\n<p>You are given a binary string <code>s</code>. You can flip <code>s[i]</code> changing it from <code>0</code> to <code>1</code> or from <code>1</code> to <code>0</code>.</p>\n\n<p>Return <em>the minimum number of flips to make </em><code>s</code><em> monotone increasing</em>.</p>\n\n<p> </p>\n<p><strong>Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = "00110"\n<strong>Output:</strong> 1\n<strong>Explanation:</strong> We flip the last digit to get 00111.\n</pre>\n\n<p><strong>Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = "010110"\n<strong>Output:</strong> 2\n<strong>Explanation:</strong> We flip to get 011111, or alternatively 000111.\n</pre>\n\n<p><strong>Example 3:</strong></p>\n\n<pre>\n<strong>Input:</strong> s = "00011000"\n<strong>Output:</strong> 2\n<strong>Explanation:</strong> We flip to get 00000000.\n</pre>\n\n<p> </p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 10<sup>5</sup></code></li>\n\t<li><code>s[i]</code> is either <code>'0'</code> or <code>'1'</code>.</li>\n</ul>\n",
|
||||
"translatedTitle": "将字符串翻转到单调递增",
|
||||
"translatedContent": "<p>如果一个由 <code>'0'</code> 和 <code>'1'</code> 组成的字符串,是以一些 <code>'0'</code>(可能没有 <code>'0'</code>)后面跟着一些 <code>'1'</code>(也可能没有 <code>'1'</code>)的形式组成的,那么该字符串是<em>单调递增</em>的。</p>\n\n<p>我们给出一个由字符 <code>'0'</code> 和 <code>'1'</code> 组成的字符串 <code>S</code>,我们可以将任何 <code>'0'</code> 翻转为 <code>'1'</code> 或者将 <code>'1'</code> 翻转为 <code>'0'</code>。</p>\n\n<p>返回使 <code>S</code> 单调递增的最小翻转次数。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"00110\"\n<strong>输出:</strong>1\n<strong>解释:</strong>我们翻转最后一位得到 00111.\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"010110\"\n<strong>输出:</strong>2\n<strong>解释:</strong>我们翻转得到 011111,或者是 000111。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"00011000\"\n<strong>输出:</strong>2\n<strong>解释:</strong>我们翻转得到 00000000。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 10<sup>5</sup></code></li>\n\t<li><code>S</code> 中只包含字符 <code>'0'</code> 和 <code>'1'</code></li>\n</ul>\n",
|
||||
"translatedContent": "<p>如果一个二进制字符串,是以一些 <code>0</code>(可能没有 <code>0</code>)后面跟着一些 <code>1</code>(也可能没有 <code>1</code>)的形式组成的,那么该字符串是 <strong>单调递增 </strong>的。</p>\n\n<p>给你一个二进制字符串 <code>s</code>,你可以将任何 <code>0</code> 翻转为 <code>1</code> 或者将 <code>1</code> 翻转为 <code>0</code> 。</p>\n\n<p>返回使 <code>s</code> 单调递增的最小翻转次数。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"00110\"\n<strong>输出:</strong>1\n<strong>解释:</strong>翻转最后一位得到 00111.\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"010110\"\n<strong>输出:</strong>2\n<strong>解释:</strong>翻转得到 011111,或者是 000111。\n</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre>\n<strong>输入:</strong>s = \"00011000\"\n<strong>输出:</strong>2\n<strong>解释:</strong>翻转得到 00000000。\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 <= s.length <= 10<sup>5</sup></code></li>\n\t<li><code>s[i]</code> 为 <code>'0'</code> 或 <code>'1'</code></li>\n</ul>\n",
|
||||
"isPaidOnly": false,
|
||||
"difficulty": "Medium",
|
||||
"likes": 143,
|
||||
"likes": 148,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"9.3K\", \"totalSubmission\": \"16.9K\", \"totalAcceptedRaw\": 9320, \"totalSubmissionRaw\": 16950, \"acRate\": \"55.0%\"}",
|
||||
"stats": "{\"totalAccepted\": \"9.8K\", \"totalSubmission\": \"17.6K\", \"totalAcceptedRaw\": 9790, \"totalSubmissionRaw\": 17648, \"acRate\": \"55.5%\"}",
|
||||
"hints": [],
|
||||
"solution": null,
|
||||
"status": null,
|
||||
|
Reference in New Issue
Block a user