1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-09-02 14:12:17 +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

@@ -8,11 +8,11 @@
"title": "Count Numbers with Unique Digits",
"titleSlug": "count-numbers-with-unique-digits",
"content": "<p>Given an integer <code>n</code>, return the count of all numbers with unique digits, <code>x</code>, where <code>0 &lt;= x &lt; 10<sup>n</sup></code>.</p>\n\n<p>&nbsp;</p>\n<p><strong>Example 1:</strong></p>\n\n<pre>\n<strong>Input:</strong> n = 2\n<strong>Output:</strong> 91\n<strong>Explanation:</strong> The answer should be the total numbers in the range of 0 &le; x &lt; 100, excluding 11,22,33,44,55,66,77,88,99\n</pre>\n\n<p><strong>Example 2:</strong></p>\n\n<pre>\n<strong>Input:</strong> n = 0\n<strong>Output:</strong> 1\n</pre>\n\n<p>&nbsp;</p>\n<p><strong>Constraints:</strong></p>\n\n<ul>\n\t<li><code>0 &lt;= n &lt;= 8</code></li>\n</ul>\n",
"translatedTitle": "计算各个位数不同的数字个数",
"translatedContent": "<p>给定一个<strong>非负</strong>整数 n计算各位数字都不同的数字 x 的个数,其中 0 &le; x &lt; 10<sup>n&nbsp;</sup>。</p>\n\n<p><strong>示例:</strong></p>\n\n<pre><strong>输入: </strong>2\n<strong>输出: </strong>91 \n<strong>解释: </strong>答案应为除去 <code>11,22,33,44,55,66,77,88,99 </code>外,在 [0,100) 区间内的所有数字。\n</pre>\n",
"translatedTitle": "统计各位数字都不同的数字个数",
"translatedContent": "给你一个整数 <code>n</code> ,统计并返回各位数字都不同的数字 <code>x</code> 的个数,其中 <code>0 &lt;= x &lt; 10<sup>n</sup></code><sup>&nbsp;</sup>。\n<div class=\"original__bRMd\">\n<div>\n<p>&nbsp;</p>\n\n<p><strong>示例 1</strong></p>\n\n<pre>\n<strong>输入</strong>n = 2\n<strong>输出</strong>91\n<strong>解释</strong>答案应为除去 <code>112233445566778899 </code>外,在 0 ≤ x &lt; 100 范围内的所有数字。 \n</pre>\n\n<p><strong>示例 2</strong></p>\n\n<pre>\n<strong>输入:</strong>n = 0\n<strong>输出:</strong>1\n</pre>\n</div>\n</div>\n\n<p>&nbsp;</p>\n\n<p><strong>提示:</strong></p>\n\n<ul>\n\t<li><code>0 &lt;= n &lt;= 8</code></li>\n</ul>\n",
"isPaidOnly": false,
"difficulty": "Medium",
"likes": 176,
"likes": 281,
"dislikes": 0,
"isLiked": null,
"similarQuestions": "[]",
@@ -149,7 +149,7 @@
"__typename": "CodeSnippetNode"
}
],
"stats": "{\"totalAccepted\": \"28.1K\", \"totalSubmission\": \"53.8K\", \"totalAcceptedRaw\": 28115, \"totalSubmissionRaw\": 53783, \"acRate\": \"52.3%\"}",
"stats": "{\"totalAccepted\": \"59.1K\", \"totalSubmission\": \"98.9K\", \"totalAcceptedRaw\": 59093, \"totalSubmissionRaw\": 98869, \"acRate\": \"59.8%\"}",
"hints": [
"A direct way is to use the backtracking approach.",
"Backtracking should contains three states which are (the current number, number of steps to get that number and a bitmask which represent which number is marked as visited so far in the current number). Start with state (0,0,0) and count all valid number till we reach number of steps equals to 10<sup>n</sup>.",