This website works better with JavaScript
首頁
探索
說明
登入
ikachan
/
leetcode-go
關注
1
讚好
1
複刻
0
檔案
問題管理
0
合併請求
0
Wiki
目錄樹:
1afcf4b246
分支列表
標籤列表
master
leetcode-go
/
leetcode
/
easy
/
231.power-of-two.go
231.power-of-two.go
99 B
文件歷史
原始文件
1
2
3
4
5
6
7
8
func isPowerOfTwo(n int) bool {
if n != 0 {
for n & 1 == 0 {
n >>= 1
}
}
return n == 1
}