From 8508517153112d74f6bb296df75add2c4a6e3d8c Mon Sep 17 00:00:00 2001 From: luzhzh Date: Wed, 29 May 2019 11:10:22 +0800 Subject: [PATCH] fixed 201 -1 can not shift bug --- notes/LeetCode第201号问题:数字范围按位与.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/notes/LeetCode第201号问题:数字范围按位与.md b/notes/LeetCode第201号问题:数字范围按位与.md index 42c7558..9e7a70e 100644 --- a/notes/LeetCode第201号问题:数字范围按位与.md +++ b/notes/LeetCode第201号问题:数字范围按位与.md @@ -48,7 +48,7 @@ class Solution { public: int rangeBitwiseAnd(int m, int n) { - int d = INT_MAX; + unsigned int d = INT_MAX; while ((m & d) != (n & d)) { d <<= 1; }