Skip to content

Commit 61ea733

Browse files
authored
Update sum-of-consecutive-subsequences.py
1 parent 360868a commit 61ea733

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Python/sum-of-consecutive-subsequences.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def count(d):
1818
for x in nums:
1919
c = (cnt[x-d]+1)%MOD
2020
cnt[x] = (cnt[x]+c)%MOD
21-
total = (prefix[x-d]+(c*x))%MOD
21+
total = (prefix[x-d]+(x*c))%MOD
2222
prefix[x] = (prefix[x]+total)%MOD
2323
result = (result+total)%MOD
2424
return result

0 commit comments

Comments
 (0)