Skip to content

Commit dc09f97

Browse files
committed
Create README - LeetHub
1 parent 8fd60d2 commit dc09f97

File tree

1 file changed

+44
-0
lines changed
  • 3918-check-divisibility-by-digit-sum-and-product

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<h2><a href="https://leetcode.com/problems/check-divisibility-by-digit-sum-and-product">3918. Check Divisibility by Digit Sum and Product</a></h2><h3>Easy</h3><hr><p>You are given a positive integer <code>n</code>. Determine whether <code>n</code> is divisible by the <strong>sum </strong>of the following two values:</p>
2+
3+
<ul>
4+
<li>
5+
<p>The <strong>digit sum</strong> of <code>n</code> (the sum of its digits).</p>
6+
</li>
7+
<li>
8+
<p>The <strong>digit</strong> <strong>product</strong> of <code>n</code> (the product of its digits).</p>
9+
</li>
10+
</ul>
11+
12+
<p>Return <code>true</code> if <code>n</code> is divisible by this sum; otherwise, return <code>false</code>.</p>
13+
14+
<p>&nbsp;</p>
15+
<p><strong class="example">Example 1:</strong></p>
16+
17+
<div class="example-block">
18+
<p><strong>Input:</strong> <span class="example-io">n = 99</span></p>
19+
20+
<p><strong>Output:</strong> <span class="example-io">true</span></p>
21+
22+
<p><strong>Explanation:</strong></p>
23+
24+
<p>Since 99 is divisible by the sum (9 + 9 = 18) plus product (9 * 9 = 81) of its digits (total 99), the output is true.</p>
25+
</div>
26+
27+
<p><strong class="example">Example 2:</strong></p>
28+
29+
<div class="example-block">
30+
<p><strong>Input:</strong> <span class="example-io">n = 23</span></p>
31+
32+
<p><strong>Output:</strong> <span class="example-io">false</span></p>
33+
34+
<p><strong>Explanation:</strong></p>
35+
36+
<p>Since 23 is not divisible by the sum (2 + 3 = 5) plus product (2 * 3 = 6) of its digits (total 11), the output is false.</p>
37+
</div>
38+
39+
<p>&nbsp;</p>
40+
<p><strong>Constraints:</strong></p>
41+
42+
<ul>
43+
<li><code>1 &lt;= n &lt;= 10<sup>6</sup></code></li>
44+
</ul>

0 commit comments

Comments
 (0)