Skip to content

Commit 6b9f712

Browse files
Added more test coverage for product_sum method
1 parent 0f46c07 commit 6b9f712

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

data_structures/arrays/product_sum.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ def product_sum_array(array: list[int | list]) -> int:
8282
11
8383
>>> product_sum_array([1, [2, [3, 4]]])
8484
47
85+
>>> product_sum_array([0])
86+
0
87+
>>> product_sum_array([-3.5, [1, [0.5]]])
88+
1.5
89+
>>> product_sum_array([1, -2])
90+
-1
91+
8592
"""
8693
return product_sum(array, 1)
8794

0 commit comments

Comments
 (0)