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-special-integers].html

38 lines
1.0 KiB
HTML
Raw 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.

<p>如果一个正整数每一个数位都是 <strong>互不相同</strong>&nbsp;的,我们称它是 <strong>特殊整数</strong></p>
<p>给你一个 <strong></strong>&nbsp;整数&nbsp;<code>n</code>&nbsp;,请你返回区间<em>&nbsp;</em><code>[1, n]</code>&nbsp;之间特殊整数的数目。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<b>输入:</b>n = 20
<b>输出:</b>19
<b>解释:</b>1 到 20 之间所有整数除了 11 以外都是特殊整数。所以总共有 19 个特殊整数。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<b>输入:</b>n = 5
<b>输出:</b>5
<b>解释:</b>1 到 5 所有整数都是特殊整数。
</pre>
<p><strong>示例 3</strong></p>
<pre>
<b>输入:</b>n = 135
<b>输出:</b>110
<b>解释:</b>从 1 到 135 总共有 110 个整数是特殊整数。
不特殊的部分数字为22 114 和 131 。</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n &lt;= 2 * 10<sup>9</sup></code></li>
</ul>