Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public:
- int rangeBitwiseAnd(int m, int n) {
- int x = 0;
- while ((m|x) < n)
- x = (x<<1) | 1;
- return m & ~x;
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement