diff --git a/Power of 2 b/Power of 2 new file mode 100644 index 0000000..d6e2ac9 --- /dev/null +++ b/Power of 2 @@ -0,0 +1,8 @@ +class Solution: + def isPowerofTwo(self,n): + x=1 + while x<=n: + if x==n: + return True + x=x*2 + return False