We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3e547eb commit fb5d0e7Copy full SHA for fb5d0e7
1 file changed
LeetCode/Power-of-Four.cpp
@@ -0,0 +1,10 @@
1
+class Solution {
2
+public:
3
+ bool isPowerOfFour(int n) {
4
+ if (n <= 0) return false;
5
+ while (n % 4 == 0) {
6
+ n /= 4;
7
+ }
8
+ return n == 1;
9
10
+};
0 commit comments