class Solution {
public:
int rangeBitwiseAnd(int m, int n) {
return n == m ? m : rangeBitwiseAnd(m>>1, n>>1) << 1;
}
};
201. Bitwise AND of Numbers Range
最新推荐文章于 2023-12-18 09:43:22 发布
class Solution {
public:
int rangeBitwiseAnd(int m, int n) {
return n == m ? m : rangeBitwiseAnd(m>>1, n>>1) << 1;
}
};