[go: nahoru, domu]

Skip to content

Commit

Permalink
update lc
Browse files Browse the repository at this point in the history
  • Loading branch information
lzyrapx committed Jul 5, 2020
1 parent 7dc3321 commit dd1abc5
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions LeetCode/Medium/0201.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
* @Author: zhaoyang.liang
* @Github: https://github.com/LzyRapx
* @Date: 2020-07-05 23:29:41
*/
class Solution {
public:
int rangeBitwiseAnd(int m, int n) {
int cnt = 0;
while(m != n) {
m >>= 1;
n >>= 1;
cnt++;
}
return n << cnt;
}
};

0 comments on commit dd1abc5

Please sign in to comment.