class Solution {
public int rangeBitwiseAnd(int left, int right) {
while (left < right) {
right -= right & (-right); //每次都减去最右侧的二进制的1
}
return right;
}
}
leetcode 201
最新推荐文章于 2024-11-13 11:37:20 发布