231. Power of Two

来源:互联网 发布:网络技术论坛 编辑:程序博客网 时间:2024/06/18 07:19
class Solution(object):
    def isPowerOfTwo(self, n):
        """
        :type n: int
        :rtype: bool
        """
        return n > 0 and 2147483648%n == 0
原创粉丝点击