power_is_two
power_is_two.py 源码
class Solution:
def isPowerOfTwo(self, n: int) -> bool:
return n != 0 and n & (n - 1) == 0
你可能感兴趣的文章
0
赞
热门推荐
-
2、 优质文章
-
3、 gt
-
8、 openharmony
-
9、 golang
-
10、 Vue中input框自动聚焦