Skip to content

Commit b405928

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 8af1e5b commit b405928

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

searches/binary_search.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,10 @@ def binary_search_with_duplicates(sorted_collection: list[int], item: int) -> li
272272
if list(sorted_collection) != sorted(sorted_collection):
273273
raise ValueError("sorted_collection must be sorted in ascending order")
274274

275-
276-
277275
def lower_bound(sorted_collection: list[int], item: int) -> int:
278276
"""
279277
Returns the index of the first element greater than or equal to the item.
280-
278+
281279
Args:
282280
sorted_collection: The sorted list to search.
283281
item: The item to find the lower bound for.
@@ -296,12 +294,10 @@ def lower_bound(sorted_collection: list[int], item: int) -> int:
296294
right = midpoint
297295
return left
298296

299-
300-
301297
def upper_bound(sorted_collection: list[int], item: int) -> int:
302298
"""
303299
Returns the index of the first element strictly greater than the item.
304-
300+
305301
Args:
306302
sorted_collection: The sorted list to search.
307303
item: The item to find the upper bound for.

0 commit comments

Comments
 (0)