mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-01-10 18:48:13 +08:00
34 lines
998 B
HTML
34 lines
998 B
HTML
<p><strong>自除数</strong><em> </em>是指可以被它包含的每一位数整除的数。</p>
|
||
|
||
<ul>
|
||
<li>例如,<code>128</code> 是一个 <strong>自除数</strong> ,因为 <code>128 % 1 == 0</code>,<code>128 % 2 == 0</code>,<code>128 % 8 == 0</code>。</li>
|
||
</ul>
|
||
|
||
<p><strong>自除数</strong> 不允许包含 0 。</p>
|
||
|
||
<p>给定两个整数 <code>left</code> 和 <code>right</code> ,返回一个列表,<em>列表的元素是范围 <code>[left, right]</code> 内所有的 <strong>自除数</strong></em> 。</p>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>示例 1:</strong></p>
|
||
|
||
<pre>
|
||
<strong>输入:</strong>left = 1, right = 22
|
||
<strong>输出:</strong>[1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 15, 22]
|
||
</pre>
|
||
|
||
<p><strong>示例 2:</strong></p>
|
||
|
||
<pre>
|
||
<b>输入:</b>left = 47, right = 85
|
||
<b>输出:</b>[48,55,66,77]
|
||
</pre>
|
||
|
||
<p> </p>
|
||
|
||
<p><strong>提示:</strong></p>
|
||
|
||
<ul>
|
||
<li><code>1 <= left <= right <= 10<sup>4</sup></code></li>
|
||
</ul>
|