mirror of
https://gitee.com/coder-xiaomo/leetcode-problemset
synced 2025-09-05 15:31:43 +08:00
36 lines
1.3 KiB
HTML
36 lines
1.3 KiB
HTML
<p data-end="387" data-start="189">You are given two positive integers, <code><font face="monospace">l</font></code> and <code><font face="monospace">r</font></code>. A positive integer is called <strong data-end="276" data-start="263">beautiful</strong> if the product of its digits is divisible by the sum of its digits.</p>
|
|
|
|
<p data-end="529" data-start="448">Return the count of <strong>beautiful</strong> numbers between <code>l</code> and <code>r</code>, inclusive.</p>
|
|
|
|
<p> </p>
|
|
<p><strong class="example">Example 1:</strong></p>
|
|
|
|
<div class="example-block">
|
|
<p><strong>Input:</strong> <span class="example-io">l = 10, r = 20</span></p>
|
|
|
|
<p><strong>Output:</strong> <span class="example-io">2</span></p>
|
|
|
|
<p><strong>Explanation:</strong></p>
|
|
|
|
<p>The beautiful numbers in the range are 10 and 20.</p>
|
|
</div>
|
|
|
|
<p><strong class="example">Example 2:</strong></p>
|
|
|
|
<div class="example-block">
|
|
<p><strong>Input:</strong> <span class="example-io">l = 1, r = 15</span></p>
|
|
|
|
<p><strong>Output:</strong> <span class="example-io">10</span></p>
|
|
|
|
<p><strong>Explanation:</strong></p>
|
|
|
|
<p>The beautiful numbers in the range are 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10.</p>
|
|
</div>
|
|
|
|
<p> </p>
|
|
<p><strong>Constraints:</strong></p>
|
|
|
|
<ul>
|
|
<li><code>1 <= l <= r < 10<sup>9</sup></code></li>
|
|
</ul>
|