```
class Solution {
public:
int rangeBitwiseAnd(int m, int n) {
int result = 0;
for(int i = 0; i < 32; i++){
int currDigit = 1 << i;
if(n-m < currDigit && m & currDigit && n & currDigit){
result += currDigit;
}
}
return result;
}
};
```