1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-10-22 05:26: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>0</code> 就是 <code>1</code> ,那么该数字就是一个 <strong>十-二进制数</strong> 。例如,<code>101</code> 和 <code>1100</code> 都是 <strong>十-二进制数</strong>,而 <code>112</code> 和 <code>3001</code> 不是。</p>\n\n<p>给你一个表示十进制整数的字符串 <code>n</code> ,返回和为 <code>n</code> 的 <strong>十-二进制数 </strong>的最少数目。</p>\n\n<p> </p>\n\n<p><strong>示例 1</strong></p>\n\n<pre><strong>输入:</strong>n = \"32\"\n<strong>输出:</strong>3\n<strong>解释:</strong>10 + 11 + 11 = 32\n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre><strong>输入:</strong>n = \"82734\"\n<strong>输出:</strong>8\n</pre>\n\n<p><strong>示例 3</strong></p>\n\n<pre><strong>输入:</strong>n = \"27346209830709182346\"\n<strong>输出:</strong>9\n</pre>\n\n<p> </p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>1 &lt;= n.length &lt;= 10<sup>5</sup></code></li>\n\t<li><code>n</code> 仅由数字组成</li>\n\t<li><code>n</code> 不含任何前导零并总是表示正整数</li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 25,
"likes": 26,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -143,7 +143,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"16.9K\", \"totalSubmission\": \"19.5K\", \"totalAcceptedRaw\": 16881, \"totalSubmissionRaw\": 19503, \"acRate\": \"86.6%\"}",
"stats": "{\"totalAccepted\": \"17.3K\", \"totalSubmission\": \"20K\", \"totalAcceptedRaw\": 17313, \"totalSubmissionRaw\": 20016, \"acRate\": \"86.5%\"}",
"hints": [
"Think about if the input was only one digit. Then you need to add up as many ones as the value of this digit.",
"If the input has multiple digits, then you can solve for each digit independently, and merge the answers to form numbers that add up to that input.",