Skip to content

Commit 4898fae

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 708818d commit 4898fae

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

searches/binary_search_on_answers.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def binary_search_on_answer(
4040

4141
return answer
4242

43+
4344
# Doctests-1. Doctests for binary_search_on_answer
4445

4546
"""
@@ -71,6 +72,7 @@ def binary_search_on_answer(
7172

7273
# Example1: minimum capacity to ship
7374

75+
7476
def min_capacity_to_ship(weights: list[int], days: int) -> int:
7577
"""
7678
Find minimum capacity to ship packages within given days.
@@ -93,6 +95,7 @@ def can_ship(capacity: int) -> bool:
9395

9496
return binary_search_on_answer(max(weights), sum(weights), can_ship)
9597

98+
9699
# Doctest-2. Doctests for min_capacity_to_ship
97100

98101
"""
@@ -117,4 +120,4 @@ def can_ship(capacity: int) -> bool:
117120
>>> def condition(x): return x >= 100
118121
>>> binary_search_on_answer(0, 50, condition)
119122
50
120-
"""
123+
"""

0 commit comments

Comments
 (0)