int Log2(int n) {
return log(n)/log(2);
}
int rangeBitwiseAnd(int m, int n) {
int diff;
// special case
if (m == n)
return m;
else {
diff = Log2(nm) + 1;
m >>= diff;
n >>= diff;
return (m & n) << diff;
}
}
C/CPP soln, no loops/recursion

That won't work. it has to be (m&n), because the difference is a conservative estimate. The difference tells us which bits would change, in the best case  i.e., if the difference between m and n is 1, then diff = 1. But this might not work if the difference caused more than 1 bit to flip.
For example, for [11,12], diff = 1, the difference would only shift the last bit. If we were to do m << diff or n << diff, we wouldn't account for the fact that 3 bits have flipped.