Skip to content

Commit cb320de

Browse files
committed
201
1 parent a8bd99d commit cb320de

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Diff for: 201.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
class Solution {
2+
public:
3+
int rangeBitwiseAnd(int m, int n) {
4+
int count=0;
5+
while(m!=n){
6+
m=m>>1;
7+
n=n>>1;
8+
count++;
9+
}
10+
return (m<<count);
11+
}
12+
};

0 commit comments

Comments
 (0)