1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-10 18:48:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/统计各位数字都不同的数字个数 [count-numbers-with-unique-digits].html

30 lines
726 B
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

给你一个整数 <code>n</code> ,统计并返回各位数字都不同的数字 <code>x</code> 的个数,其中 <code>0 &lt;= x &lt; 10<sup>n</sup></code><sup>&nbsp;</sup>
<div class="original__bRMd">
<div>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>n = 2
<strong>输出:</strong>91
<strong>解释:</strong>答案应为除去 <code>11、22、33、44、55、66、77、88、99 </code>外,在 0 ≤ x &lt; 100 范围内的所有数字。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>n = 0
<strong>输出:</strong>1
</pre>
</div>
</div>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>0 &lt;= n &lt;= 8</code></li>
</ul>