mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 03:27:07 +00:00
11 lines
255 B
Python
11 lines
255 B
Python
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 |