Skip to content

Commit afb65e1

Browse files
aQuaaQua
aQua
authored and
aQua
committed
115 ut pass
1 parent 53e4579 commit afb65e1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Algorithms/0115.distinct-subsequences/distinct-subsequences.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func numDistinct(s string, t string) int {
2323

2424
for i := j + 1; i <= m; i++ {
2525
if n-j <= m-i && s[i-1] == t[j-1] {
26-
dp[i][j] = dp[i][j-1] + dp[i-1][j]
26+
dp[i][j] = dp[i-1][j-1] + dp[i-1][j]
2727
} else {
2828
dp[i][j] = dp[i-1][j]
2929
}

0 commit comments

Comments
 (0)