We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 708818d commit 4898faeCopy full SHA for 4898fae
1 file changed
searches/binary_search_on_answers.py
@@ -40,6 +40,7 @@ def binary_search_on_answer(
40
41
return answer
42
43
+
44
# Doctests-1. Doctests for binary_search_on_answer
45
46
"""
@@ -71,6 +72,7 @@ def binary_search_on_answer(
71
72
73
# Example1: minimum capacity to ship
74
75
76
def min_capacity_to_ship(weights: list[int], days: int) -> int:
77
78
Find minimum capacity to ship packages within given days.
@@ -93,6 +95,7 @@ def can_ship(capacity: int) -> bool:
93
95
94
96
return binary_search_on_answer(max(weights), sum(weights), can_ship)
97
98
99
# Doctest-2. Doctests for min_capacity_to_ship
100
101
@@ -117,4 +120,4 @@ def can_ship(capacity: int) -> bool:
117
120
>>> def condition(x): return x >= 100
118
121
>>> binary_search_on_answer(0, 50, condition)
119
122
50
-"""
123
+"""
0 commit comments