Skip to content

Commit 8edb773

Browse files
committed
Time: 0 ms (100.00%) | Memory: 7.9 MB (18.25%) - LeetSync
1 parent b2dd903 commit 8edb773

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

342-power-of-four/power-of-four.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
class Solution {
2+
public:
3+
bool isPowerOfFour(int n) {
4+
if(n == 0) return false;
5+
if(n == 1) return true;
6+
return (n%4==0)?isPowerOfFour(n/4):false;
7+
8+
}
9+
};

0 commit comments

Comments
 (0)