mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 15:31:43 +08:00
update
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
"translatedContent": "<p>给你一个二进制字符串 <code>binary</code> 。 <code>binary</code> 的一个 <strong>子序列</strong> 如果是 <strong>非空</strong> 的且没有 <b>前导</b> <strong>0</strong> (除非数字是 <code>\"0\"</code> 本身),那么它就是一个 <strong>好</strong> 的子序列。</p>\n\n<p>请你找到 <code>binary</code> <strong>不同好子序列</strong> 的数目。</p>\n\n<ul>\n\t<li>比方说,如果 <code>binary = \"001\"</code> ,那么所有 <strong>好</strong> 子序列为 <code>[\"0\", \"0\", \"1\"]</code> ,所以 <b>不同</b> 的好子序列为 <code>\"0\"</code> 和 <code>\"1\"</code> 。 注意,子序列 <code>\"00\"</code> ,<code>\"01\"</code> 和 <code>\"001\"</code> 不是好的,因为它们有前导 0 。</li>\n</ul>\n\n<p>请你返回 <code>binary</code> 中 <strong>不同好子序列</strong> 的数目。由于答案可能很大,请将它对 <code>10<sup>9</sup> + 7</code> <strong>取余</strong> 后返回。</p>\n\n<p>一个 <strong>子序列</strong> 指的是从原数组中删除若干个(可以一个也不删除)元素后,不改变剩余元素顺序得到的序列。</p>\n\n<p> </p>\n\n<p><strong>示例 1:</strong></p>\n\n<pre><b>输入:</b>binary = \"001\"\n<b>输出:</b>2\n<b>解释:</b>好的二进制子序列为 [\"0\", \"0\", \"1\"] 。\n不同的好子序列为 \"0\" 和 \"1\" 。\n</pre>\n\n<p><strong>示例 2:</strong></p>\n\n<pre><b>输入:</b>binary = \"11\"\n<b>输出:</b>2\n<b>解释:</b>好的二进制子序列为 [\"1\", \"1\", \"11\"] 。\n不同的好子序列为 \"1\" 和 \"11\" 。</pre>\n\n<p><strong>示例 3:</strong></p>\n\n<pre><b>输入:</b>binary = \"101\"\n<b>输出:</b>5\n<b>解释:</b>好的二进制子序列为 [\"1\", \"0\", \"1\", \"10\", \"11\", \"101\"] 。\n不同的好子序列为 \"0\" ,\"1\" ,\"10\" ,\"11\" 和 \"101\" 。\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": "Hard",
|
||||
"likes": 28,
|
||||
"likes": 30,
|
||||
"dislikes": 0,
|
||||
"isLiked": null,
|
||||
"similarQuestions": "[]",
|
||||
@@ -143,7 +143,7 @@
|
||||
"__typename": "CodeSnippetNode"
|
||||
}
|
||||
],
|
||||
"stats": "{\"totalAccepted\": \"1.7K\", \"totalSubmission\": \"3.5K\", \"totalAcceptedRaw\": 1713, \"totalSubmissionRaw\": 3542, \"acRate\": \"48.4%\"}",
|
||||
"stats": "{\"totalAccepted\": \"1.8K\", \"totalSubmission\": \"3.6K\", \"totalAcceptedRaw\": 1755, \"totalSubmissionRaw\": 3616, \"acRate\": \"48.5%\"}",
|
||||
"hints": [
|
||||
"The number of unique good subsequences is equal to the number of unique decimal values there are for all possible subsequences.",
|
||||
"Find the answer at each index based on the previous indexes' answers."
|
||||
|
Reference in New Issue
Block a user