1
0
mirror of https://gitee.com/coder-xiaomo/leetcode-problemset synced 2025-01-11 19:18:14 +08:00
Code Issues Projects Releases Wiki Activity GitHub Gitee
leetcode-problemset/leetcode-cn/problem (Chinese)/自除数 [self-dividing-numbers].html

34 lines
998 B
HTML
Raw Normal View History

2022-03-27 20:46:41 +08:00
<p><strong>自除数</strong><em>&nbsp;</em>是指可以被它包含的每一位数整除的数。</p>
<ul>
<li>例如,<code>128</code> 是一个 <strong>自除数</strong> ,因为&nbsp;<code>128 % 1 == 0</code><code>128 % 2 == 0</code><code>128 % 8 == 0</code></li>
</ul>
<p><strong>自除数</strong> 不允许包含 0 。</p>
<p>给定两个整数&nbsp;<code>left</code>&nbsp;&nbsp;<code>right</code> ,返回一个列表,<em>列表的元素是范围&nbsp;<code>[left, right]</code>&nbsp;内所有的 <strong>自除数</strong></em></p>
<p>&nbsp;</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>&nbsp;</p>
<p><strong>提示:</strong></p>
<ul>
<li><code>1 &lt;= left &lt;= right &lt;= 10<sup>4</sup></code></li>
</ul>