class Solution(object):
def isPowerOfFour(self, num):
"""
:type num: int
:rtype: bool
"""
return num>0 and num&num-1==0 and num&int('55555555',16)==num
class Solution(object):
def isPowerOfFour(self, num):
"""
:type num: int
:rtype: bool
"""
return num>0 and num&num-1==0 and num&int('55555555',16)==num
本文标题:342. Power of Four
本文链接:https://www.haomeiwen.com/subject/pdvvvttx.html
网友评论