Skip to content

Commit 993707d

Browse files
authored
Update 940.Distinct-Subsequences-II.cpp
1 parent 94ab469 commit 993707d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Dynamic_Programming/940.Distinct-Subsequences-II/940.Distinct-Subsequences-II.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ class Solution {
1717
last[s[i]-'a'] = i;
1818
}
1919

20-
return dp[n] - 1;
20+
return ((dp[n] + M )- 1) % M;
2121
}
2222
};

0 commit comments

Comments
 (0)