This website works better with JavaScript
Trang chủ
Khám phá
Trợ giúp
Đăng nhập
ikachan
/
leetcode-go
Xem
1
Star
1
Fork
0
Các tập tin
Các vấn đề
0
Yêu cầu khéo về
0
Wiki
Tree:
05139d8ac5
Branches
Tags
master
leetcode-go
/
leetcode
/
easy
/
231.power-of-two.go
231.power-of-two.go
99 B
Lịch sử
Raw
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
}