Skip to content

Commit 0a0d181

Browse files
authored
Update search-for-a-range.py
1 parent fb05de1 commit 0a0d181

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
@@ -55,7 +55,7 @@ def binarySearch3(self, compare, nums, target):
5555
right = mid
5656
else:
5757
left = mid
58-
return right
58+
return left if compare(nums[left], target) else right
5959

6060

6161
if __name__ == "__main__":

0 commit comments

Comments
 (0)