Commit 85085171 authored by luzhzh's avatar luzhzh
Browse files

fixed 201 -1 can not shift bug

parent dc285aa7
...@@ -48,7 +48,7 @@ ...@@ -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;
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment