int rangeBitwiseAnd(int m, int n)
int t = m ^ n;
while (t >>= 1)
unsigned int mask = ~((1 << msb) -1);
return m & mask;
the code I wrote here is not correct, so I removed it in case someone might be misled...
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.