Skip to content

Commit b11d98f

Browse files
Sync LeetCode submission Runtime - 0 ms (100.00%), Memory - 19.4 MB (51.52%)
1 parent 800bc47 commit b11d98f

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • LeetCode/0693-binary-number-with-alternating-bits
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
class Solution:
2+
def hasAlternatingBits(self, n: int) -> bool:
3+
return not(((n^(n>>1))+1)&(n^(n>>1)))

0 commit comments

Comments
 (0)