1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 02:58:13 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/至少有 1 位重复的数字 [numbers-with-repeated-digits].html
2022-03-29 12:43:11 +08:00

35 lines
891 B
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>给定正整数&nbsp;<code>n</code>,返回在<em>&nbsp;</em><code>[1, n]</code><em>&nbsp;</em>范围内具有 <strong>至少 1 位</strong> 重复数字的正整数的个数。</p>
<p>&nbsp;</p>
<p><strong>示例 1</strong></p>
<pre>
<strong>输入:</strong>n = 20
<strong>输出:</strong>1
<strong>解释:</strong>具有至少 1 位重复数字的正数(&lt;= 20只有 11 。
</pre>
<p><strong>示例 2</strong></p>
<pre>
<strong>输入:</strong>n = 100
<strong>输出:</strong>10
<strong>解释:</strong>具有至少 1 位重复数字的正数(&lt;= 100有 112233445566778899 和 100 。
</pre>
<p><strong>示例 3</strong></p>
<pre>
<strong>输入:</strong>n = 1000
<strong>输出:</strong>262
</pre>
<p>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= n &lt;= 10<sup>9</sup></code></li>
</ul>