class Solution {
public:
int rangeBitwiseAnd(int m, int n) {
int t=m&n,ans=0;
n-=m;
while(t){
int k=t&-t;
if(k>=n) ans+=k;
t-=k;
}
return ans;
}
};
Leetcode 201. 数字范围按位与
最新推荐文章于 2024-08-11 14:21:11 发布