Time: 36 ms (60.65%), Space: 13.7 MB (93.73%) - LeetHub

This commit is contained in:
Deven
2023-02-07 14:52:18 -05:00
parent 40befbeb2a
commit da957252a9
+5
View File
@@ -0,0 +1,5 @@
class Solution:
def isPowerOfTwo(self, n: int) -> bool:
if n < 0:
return False
return bin(n).count("1") == 1