mirror of
https://github.com/devenperez/leetcode.git
synced 2026-06-13 03:27:07 +00:00
Time: 36 ms (60.65%), Space: 13.7 MB (93.73%) - LeetHub
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
class Solution:
|
||||
def isPowerOfTwo(self, n: int) -> bool:
|
||||
if n < 0:
|
||||
return False
|
||||
return bin(n).count("1") == 1
|
||||
Reference in New Issue
Block a user