数字范围按位与⚓︎ Leetcode题目链接 描述⚓︎ 详见中文题目链接。 解答⚓︎ 1 2 3 4 5 6 7 8 9class Solution { public: int rangeBitwiseAnd(int left, int right) { while (left < right) { right = right & (right - 1); } return right; } };