Skip to content

Commit 4b97c60

Browse files
committed
Create README - LeetHub
1 parent 2a38d8b commit 4b97c60

File tree

1 file changed

+37
-0
lines changed
  • 4054-count-distinct-integers-after-removing-zeros

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/count-distinct-integers-after-removing-zeros">4054. Count Distinct Integers After Removing Zeros</a></h2><h3>Medium</h3><hr><p>You are given a <strong>positive</strong> integer <code>n</code>.</p>
2+
3+
<p>For every integer <code>x</code> from 1 to <code>n</code>, we write down the integer obtained by removing all zeros from the decimal representation of <code>x</code>.</p>
4+
5+
<p>Return an integer denoting the number of <strong>distinct</strong> integers written down.</p>
6+
7+
<p>&nbsp;</p>
8+
<p><strong class="example">Example 1:</strong></p>
9+
10+
<div class="example-block">
11+
<p><strong>Input:</strong> <span class="example-io">n = 10</span></p>
12+
13+
<p><strong>Output:</strong> <span class="example-io">9</span></p>
14+
15+
<p><strong>Explanation:</strong></p>
16+
17+
<p>The integers we wrote down are 1, 2, 3, 4, 5, 6, 7, 8, 9, 1. There are 9 distinct integers (1, 2, 3, 4, 5, 6, 7, 8, 9).</p>
18+
</div>
19+
20+
<p><strong class="example">Example 2:</strong></p>
21+
22+
<div class="example-block">
23+
<p><strong>Input:</strong> <span class="example-io">n = 3</span></p>
24+
25+
<p><strong>Output:</strong> <span class="example-io">3</span></p>
26+
27+
<p><strong>Explanation:</strong></p>
28+
29+
<p>The integers we wrote down are 1, 2, 3. There are 3 distinct integers (1, 2, 3).</p>
30+
</div>
31+
32+
<p>&nbsp;</p>
33+
<p><strong>Constraints:</strong></p>
34+
35+
<ul>
36+
<li><code>1 &lt;= n &lt;= 10<sup>15</sup></code></li>
37+
</ul>

0 commit comments

Comments
 (0)