class Solution {
public boolean isPowerOfTwo(int n) {
return (n > 0) && (n == (n & (-n)));
}
}
leetcode 231
最新推荐文章于 2024-11-13 11:37:20 发布
class Solution {
public boolean isPowerOfTwo(int n) {
return (n > 0) && (n == (n & (-n)));
}
}