Skip to content

Commit 6bd76ea

Browse files
Update data_structures/stacks/stock_span_problem.py
Co-authored-by: Christian Clauss <[email protected]>
1 parent c76afc8 commit 6bd76ea

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

data_structures/stacks/stock_span_problem.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ def calculation_span(price: list[float]) -> list[float]:
2929
>>> price = [10, 20, 30, 40, 50]
3030
>>> calculation_span(price)
3131
[1.0, 2.0, 3.0, 4.0, 5.0]
32+
>>> calculation_span(price=[100, 80, 60, 70, 60, 75, 85])
33+
[1.0, 1.0, 1.0, 2.0, 1.0, 4.0, 6.0]
34+
>>> calculation_span(price=[10, 4, 5, 90, 120, 80])
35+
[1.0, 1.0, 2.0, 4.0, 5.0, 1.0]
3236
"""
3337
n = len(price)
3438
st = [0]

0 commit comments

Comments
 (0)