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

35 lines
891 B
HTML
Raw Normal View History

2022-03-27 20:46:41 +08:00
<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>