Skip to content

Commit 1ef047f

Browse files
committed
Create README - LeetHub
1 parent 0bb1826 commit 1ef047f

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

0231-power-of-two/README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<h2><a href="https://leetcode.com/problems/power-of-two/">231. Power of Two</a></h2><h3>Easy</h3><hr><div><p>Given an integer <code>n</code>, return <em><code>true</code> if it is a power of two. Otherwise, return <code>false</code></em>.</p>
2+
3+
<p>An integer <code>n</code> is a power of two, if there exists an integer <code>x</code> such that <code>n == 2<sup>x</sup></code>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
8+
<pre><strong>Input:</strong> n = 1
9+
<strong>Output:</strong> true
10+
<strong>Explanation: </strong>2<sup>0</sup> = 1
11+
</pre>
12+
13+
<p><strong class="example">Example 2:</strong></p>
14+
15+
<pre><strong>Input:</strong> n = 16
16+
<strong>Output:</strong> true
17+
<strong>Explanation: </strong>2<sup>4</sup> = 16
18+
</pre>
19+
20+
<p><strong class="example">Example 3:</strong></p>
21+
22+
<pre><strong>Input:</strong> n = 3
23+
<strong>Output:</strong> false
24+
</pre>
25+
26+
<p>&nbsp;</p>
27+
<p><strong>Constraints:</strong></p>
28+
29+
<ul>
30+
<li><code>-2<sup>31</sup> &lt;= n &lt;= 2<sup>31</sup> - 1</code></li>
31+
</ul>
32+
33+
<p>&nbsp;</p>
34+
<strong>Follow up:</strong> Could you solve it without loops/recursion?</div>

0 commit comments

Comments
 (0)