摘要: 自己写的,如果n对4可以整除。就让n除以4,循环往复 class Solution: def isPowerOfFour(self, n: int) -> bool: while n%4==0 and n>0: n//=4 return n==1 阅读全文
posted @ 2024-04-08 09:29 Junior_bond 阅读(5) 评论(0) 推荐(0)