mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-15 09:57:09 +00:00
Time: 33 ms (71.88%), Space: 13.8 MB (93.74%) - LeetHub
This commit is contained in:
@@ -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
|
||||||
Reference in New Issue
Block a user