This website works better with JavaScript
Etusivu
Tutki
Apua
Kirjaudu sisään
ikachan
/
leetcode-go
Tarkkaile
1
Äänestä
1
Fork
0
Tiedostot
Ongelmat
0
Pull-pyynnöt
0
Wiki
Puu:
1afcf4b246
Branchit
Tagit
master
leetcode-go
/
leetcode
/
easy
/
231.power-of-two.go
231.power-of-two.go
99 B
Historia
Raaka
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
}