Skip to content

Commit c6063fb

Browse files
committed
Create README - LeetHub
1 parent 0ef8b1e commit c6063fb

File tree

1 file changed

+37
-0
lines changed
  • 1015-smallest-integer-divisible-by-k

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<h2><a href="https://leetcode.com/problems/smallest-integer-divisible-by-k">1064. Smallest Integer Divisible by K</a></h2><h3>Medium</h3><hr><p>Given a positive integer <code>k</code>, you need to find the <strong>length</strong> of the <strong>smallest</strong> positive integer <code>n</code> such that <code>n</code> is divisible by <code>k</code>, and <code>n</code> only contains the digit <code>1</code>.</p>
2+
3+
<p>Return <em>the <strong>length</strong> of </em><code>n</code>. If there is no such <code>n</code>, return -1.</p>
4+
5+
<p><strong>Note:</strong> <code>n</code> may not fit in a 64-bit signed integer.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<pre>
11+
<strong>Input:</strong> k = 1
12+
<strong>Output:</strong> 1
13+
<strong>Explanation:</strong> The smallest answer is n = 1, which has length 1.
14+
</pre>
15+
16+
<p><strong class="example">Example 2:</strong></p>
17+
18+
<pre>
19+
<strong>Input:</strong> k = 2
20+
<strong>Output:</strong> -1
21+
<strong>Explanation:</strong> There is no such positive integer n divisible by 2.
22+
</pre>
23+
24+
<p><strong class="example">Example 3:</strong></p>
25+
26+
<pre>
27+
<strong>Input:</strong> k = 3
28+
<strong>Output:</strong> 3
29+
<strong>Explanation:</strong> The smallest answer is n = 111, which has length 3.
30+
</pre>
31+
32+
<p>&nbsp;</p>
33+
<p><strong>Constraints:</strong></p>
34+
35+
<ul>
36+
<li><code>1 &lt;= k &lt;= 10<sup>5</sup></code></li>
37+
</ul>

0 commit comments

Comments
 (0)