Skip to content

Instantly share code, notes, and snippets.

@xzhang311
Created April 1, 2016 16:02
class Solution {
public:
int rangeBitwiseAnd(int m, int n) {
int trans = 0;
while(m != n)
{
++ trans;
m >>= 1;
n >>= 1;
}
return m << trans;
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment