This website works better with JavaScript
Home
Esplora
Aiuto
Accedi
ikachan
/
leetcode-go
Segui
1
Vota
1
Forka
0
File
Problemi
0
Pull Requests
0
Wiki
Albero (Tree):
05139d8ac5
Rami (Branch)
Tag
master
leetcode-go
/
leetcode
/
easy
/
231.power-of-two.go
231.power-of-two.go
99 B
Cronologia
Originale
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
}