342. 4的幂
题目链接
https://leetcode.cn/problems/power-of-four/description/
解题思路
参考3的幂。
代码
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) else: return False