mirror of
https://gitee.com/TheAlgorithms/LeetCodeAnimation.git
synced 2024-12-06 15:19:44 +08:00
fixed 201 -1 can not shift bug
This commit is contained in:
parent
dc285aa7a1
commit
8508517153
@ -48,7 +48,7 @@
|
|||||||
class Solution {
|
class Solution {
|
||||||
public:
|
public:
|
||||||
int rangeBitwiseAnd(int m, int n) {
|
int rangeBitwiseAnd(int m, int n) {
|
||||||
int d = INT_MAX;
|
unsigned int d = INT_MAX;
|
||||||
while ((m & d) != (n & d)) {
|
while ((m & d) != (n & d)) {
|
||||||
d <<= 1;
|
d <<= 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user