This website works better with JavaScript
Página Principal
Explorar
Ajuda
Iniciar Sessão
ikachan
/
leetcode-go
Vigiar
1
Colocar Estrela
1
Fork
0
Ficheiros
Problemas
0
Pull Requests
0
Wiki
Árvore:
514ec075d8
Ramos
Etiquetas
master
leetcode-go
/
leetcode
/
easy
/
231.power-of-two.go
231.power-of-two.go
99 B
Histórico
Em bruto
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
}