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 b1d8b77 commit 6f2073eCopy full SHA for 6f2073e
rust/medium/0232_power_of_two.rs
@@ -0,0 +1,5 @@
1
+impl Solution {
2
+ pub fn is_power_of_two(n: i32) -> bool {
3
+ n > 0 && n & (n - 1) == 0
4
+ }
5
+}
0 commit comments