```
public class Solution {
public int rangeBitwiseAnd(int m, int n) {
int mask = Integer.MAX_VALUE;
while ((m & mask) != (n & mask)) mask <<= 1;
return mask & m;
}
}
```

The only bits that will be 1 will be bits that are common to the upper bits of m and n. Everything else will have at least one instance of a 0 in that range.