Skip to content

Latest commit

 

History

History
15 lines (15 loc) · 267 Bytes

231.md

File metadata and controls

15 lines (15 loc) · 267 Bytes

#231. Power of Two 题目链接

class Solution(object):
	def isPowerOfTwo(self, n):
		"""
		:type n: int
		:rtype: bool
		"""
		if n <=0:
		    return False
		if n & n -1 == 0:
			return True
		return False