Skip to content

Commit 52fb458

Browse files
committed
Fix duplicate raise and formatting issue
1 parent 572f817 commit 52fb458

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

searches/binary_search.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,8 +391,10 @@ def exponential_search(sorted_collection: list[int], item: int) -> int:
391391
"""
392392
if list(sorted_collection) != sorted(sorted_collection):
393393
raise ValueError(
394-
"Input list must be sorted in ascending order for binary search to work"
394+
"Input list must be sorted in ascending order"
395+
"for binary search to work"
395396
)
397+
396398
bound = 1
397399
while bound < len(sorted_collection) and sorted_collection[bound] < item:
398400
bound *= 2

0 commit comments

Comments
 (0)