Skip to content

Commit 1157c73

Browse files
added daily challenge
1 parent ffaabb7 commit 1157c73

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

231. Power of Two.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
class Solution:
2+
def isPowerOfTwo(self, n: int) -> bool:
3+
while n > 1:
4+
if n % 2 != 0:
5+
return False
6+
n = n // 2
7+
return n == 1

0 commit comments

Comments
 (0)