Skip to content

Commit cdf45f3

Browse files
committed
Fix off-by-one indexing bug
1 parent 52b9e01 commit cdf45f3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MiniPy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
def cumsum(lst):
13-
return [sum(lst[:i]) for i in range(len(lst))]
13+
return [sum(lst[:i]) for i in range(1, len(lst)+1)]
1414

1515

1616
def cumprod(lst, use_logsum=False):

0 commit comments

Comments
 (0)