Time: 33 ms (71.88%), Space: 13.8 MB (93.74%) - LeetHub

This commit is contained in:
Deven
2023-02-10 17:17:44 -05:00
parent 7ec10a8a70
commit 6414f69350
+11
View File
@@ -0,0 +1,11 @@
class Solution:
def isPowerOfFour(self, n: int) -> bool:
if n <= 0:
return False
if n == 1:
return True
if n % 4 == 0:
return self.isPowerOfFour(n / 4)
return False