Skip to content

Commit 3799311

Browse files
committed
Solved leetcode 201
1 parent bee93d9 commit 3799311

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Diff for: 201/201.py

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
class Solution:
2+
def rangeBitwiseAnd(self, left: int, right: int) -> int:
3+
count = 0
4+
while(left != right):
5+
left = left >> 1
6+
right = right >> 1
7+
count += 1
8+
9+
return left << count
10+

0 commit comments

Comments
 (0)