Skip to content

Commit 036698d

Browse files
committed
Fix ruff errors(line length and spacing)
1 parent 6891fee commit 036698d

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

searches/binary_search.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,8 @@ def binary_search(sorted_collection: list[int], item: int) -> int:
199199
"""
200200
if any(a > b for a, b in pairwise(sorted_collection)):
201201
raise ValueError(
202-
"Input list must be sorted in ascending order for binary search to work in ascending order"
202+
"Input list must be sorted in ascending order "
203+
"for binary search to work"
203204
)
204205
left = 0
205206
right = len(sorted_collection) - 1
@@ -238,7 +239,8 @@ def binary_search_std_lib(sorted_collection: list[int], item: int) -> int:
238239
"""
239240
if list(sorted_collection) != sorted(sorted_collection):
240241
raise ValueError(
241-
"Input list must be sorted in ascending order for binary search to work"
242+
"Input list must be sorted in ascending order "
243+
"for binary search to work"
242244
)
243245
index = bisect.bisect_left(sorted_collection, item)
244246
if index != len(sorted_collection) and sorted_collection[index] == item:
@@ -274,7 +276,8 @@ def binary_search_with_duplicates(sorted_collection: list[int], item: int) -> li
274276
"""
275277
if list(sorted_collection) != sorted(sorted_collection):
276278
raise ValueError(
277-
"Input list must be sorted in ascending order for binary search to work"
279+
"Input list must be sorted in ascending order "
280+
"for binary search to work"
278281
)
279282

280283
def lower_bound(sorted_collection: list[int], item: int) -> int:
@@ -391,7 +394,8 @@ def exponential_search(sorted_collection: list[int], item: int) -> int:
391394
"""
392395
if list(sorted_collection) != sorted(sorted_collection):
393396
raise ValueError(
394-
"Input list must be sorted in ascending orderfor binary search to work"
397+
"Input list must be sorted in ascending order "
398+
"for binary search to work"
395399
)
396400

397401
bound = 1

0 commit comments

Comments
 (0)