S2
S2 copied to clipboard
0231. Power of Two | LeetCode Cookbook
https://books.halfrost.com/leetcode/ChapterFour/0200~0299/0231.Power-of-Two/
判断是不是等于lowbit:
func isPowerOfTwo(n int) bool {
if n <= 0 {
return false
}
lowbit := n & (-n)
return lowbit == n
}