Use n&n-1 to change the last "bit 1" of n to "bit 0". Keep doing it until the n is not in the original range. Learned from http://blog.csdn.net/lu597203933/article/details/44811049.
class Solution {
public:
int rangeBitwiseAnd(int m, int n) {
while(n>m)
n&=n-1;
return n;
}
};