Skip to content

Commit 8508517

Browse files
committed
fixed 201 -1 can not shift bug
1 parent dc285aa commit 8508517

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

notes/LeetCode第201号问题:数字范围按位与.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
class Solution {
4949
public:
5050
int rangeBitwiseAnd(int m, int n) {
51-
int d = INT_MAX;
51+
unsigned int d = INT_MAX;
5252
while ((m & d) != (n & d)) {
5353
d <<= 1;
5454
}

0 commit comments

Comments
 (0)