Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 0732117

Browse files
authoredSep 25, 2021
Update design-most-recently-used-queue.py
1 parent 607ade7 commit 0732117

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎Python/design-most-recently-used-queue.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def query(self, i):
5151
return ret
5252

5353
def binary_lift(self, k):
54-
floor_log2_n = len(self.__bit).bit_length()-1
54+
floor_log2_n = (len(self.__bit)-1).bit_length()-1
5555
pow_i = 2**floor_log2_n
5656
total = pos = 0 # 1-indexed
5757
for i in reversed(xrange(floor_log2_n+1)): # O(logN)

0 commit comments

Comments
 (0)
Please sign in to comment.