mirror of
https://github.com/lWolvesl/leetcode.git
synced 2026-02-27 11:58:39 +08:00
190, 3379, 693
This commit is contained in:
6
26/02/693.go
Normal file
6
26/02/693.go
Normal file
@@ -0,0 +1,6 @@
|
||||
package A
|
||||
|
||||
func hasAlternatingBits(n int) bool {
|
||||
n = n ^ (n >> 1)
|
||||
return n&(n+1) == 0
|
||||
}
|
||||
Reference in New Issue
Block a user