Skip to content

Commit b2dd903

Browse files
committed
Added README.md file for Power of Four
1 parent 36fbcbd commit b2dd903

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

342-power-of-four/README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<h2><a href="https://leetcode.com/problems/power-of-four">Power of Four</a></h2> <img src='https://img.shields.io/badge/Difficulty-Easy-brightgreen' alt='Difficulty: Easy' /><hr><p>Given an integer <code>n</code>, return <em><code>true</code> if it is a power of four. Otherwise, return <code>false</code></em>.</p>
2+
3+
<p>An integer <code>n</code> is a power of four, if there exists an integer <code>x</code> such that <code>n == 4<sup>x</sup></code>.</p>
4+
5+
<p>&nbsp;</p>
6+
<p><strong class="example">Example 1:</strong></p>
7+
<pre><strong>Input:</strong> n = 16
8+
<strong>Output:</strong> true
9+
</pre><p><strong class="example">Example 2:</strong></p>
10+
<pre><strong>Input:</strong> n = 5
11+
<strong>Output:</strong> false
12+
</pre><p><strong class="example">Example 3:</strong></p>
13+
<pre><strong>Input:</strong> n = 1
14+
<strong>Output:</strong> true
15+
</pre>
16+
<p>&nbsp;</p>
17+
<p><strong>Constraints:</strong></p>
18+
19+
<ul>
20+
<li><code>-2<sup>31</sup> &lt;= n &lt;= 2<sup>31</sup> - 1</code></li>
21+
</ul>
22+
23+
<p>&nbsp;</p>
24+
<strong>Follow up:</strong> Could you solve it without loops/recursion?

0 commit comments

Comments
 (0)