We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0db5354 commit 47613e1Copy full SHA for 47613e1
src/main/java/com/fishercoder/solutions/_693.java
@@ -42,6 +42,7 @@ public boolean hasAlternatingBits(int n) {
42
return true;
43
}
44
45
+
46
public static class Solution2 {
47
public boolean hasAlternatingBits_oneline(int n) {
48
return Integer.bitCount(((n >> 1) ^ n) + 1) == 1;
0 commit comments