Skip to content

Latest commit

 

History

History
32 lines (20 loc) · 448 Bytes

342._Power_of_Four.md

File metadata and controls

32 lines (20 loc) · 448 Bytes

342. Power of Four

题目: https://leetcode.com/problems/power-of-four/

难度 : Easy

继续照抄power of three

class Solution(object):
    def isPowerOfFour(self, num):
        """
        :type num: int
        :rtype: bool
        """
        if num <= 0 :
        	return False
        if num == 1:
        	return True
        if num % 4 == 0:
        	return self.isPowerOfFour(num/4)
        return False