Skip to content

Commit 5ef7272

Browse files
committed
Update search-for-a-range.py
1 parent 0ad1d70 commit 5ef7272

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/search-for-a-range.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def binarySearch2(self, compare, A, target):
4646
return start
4747

4848
def binarySearch3(self, compare, A, target):
49-
start, end = -1, len(A)
49+
start, end = -1, len(A) - 1
5050
while end - start > 1:
5151
mid = start + (end - start) / 2
5252
if compare(target, A[mid]):

0 commit comments

Comments
 (0)