Skip to content

Commit eb95901

Browse files
committed
Create README - LeetHub
1 parent 8ae84be commit eb95901

File tree

1 file changed

+47
-0
lines changed
  • 3676-smallest-number-with-all-set-bits

1 file changed

+47
-0
lines changed
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<h2><a href="https://leetcode.com/problems/smallest-number-with-all-set-bits">3676. Smallest Number With All Set Bits</a></h2><h3>Easy</h3><hr><p>You are given a <em>positive</em> number <code>n</code>.</p>
2+
3+
<p>Return the <strong>smallest</strong> number <code>x</code> <strong>greater than</strong> or <strong>equal to</strong> <code>n</code>, such that the binary representation of <code>x</code> contains only <span data-keyword="set-bit">set bits</span></p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<div class="example-block">
9+
<p><strong>Input:</strong> <span class="example-io">n = 5</span></p>
10+
11+
<p><strong>Output:</strong> <span class="example-io">7</span></p>
12+
13+
<p><strong>Explanation:</strong></p>
14+
15+
<p>The binary representation of 7 is <code>&quot;111&quot;</code>.</p>
16+
</div>
17+
18+
<p><strong class="example">Example 2:</strong></p>
19+
20+
<div class="example-block">
21+
<p><strong>Input:</strong> <span class="example-io">n = 10</span></p>
22+
23+
<p><strong>Output:</strong> <span class="example-io">15</span></p>
24+
25+
<p><strong>Explanation:</strong></p>
26+
27+
<p>The binary representation of 15 is <code>&quot;1111&quot;</code>.</p>
28+
</div>
29+
30+
<p><strong class="example">Example 3:</strong></p>
31+
32+
<div class="example-block">
33+
<p><strong>Input:</strong> <span class="example-io">n = 3</span></p>
34+
35+
<p><strong>Output:</strong> <span class="example-io">3</span></p>
36+
37+
<p><strong>Explanation:</strong></p>
38+
39+
<p>The binary representation of 3 is <code>&quot;11&quot;</code>.</p>
40+
</div>
41+
42+
<p>&nbsp;</p>
43+
<p><strong>Constraints:</strong></p>
44+
45+
<ul>
46+
<li><code>1 &lt;= n &lt;= 1000</code></li>
47+
</ul>

0 commit comments

Comments
 (0)