修改 0392.判断子序列.md Go二维DP格式

修改 0392.判断子序列.md Go二维DP格式
This commit is contained in:
ShuangmingMa
2023-10-08 15:16:06 +08:00
committed by GitHub
parent 8973967dd1
commit d9e08a1bbf

View File

@ -250,7 +250,7 @@ func isSubsequence(s string, t string) bool {
}
for i := 1; i < len(dp); i ++{
for j := 1; j < len(dp[i]); j ++{
if s[i - 1] == t[j-1] {
if s[i - 1] == t[j - 1] {
dp[i][j] = dp[i - 1][j - 1] +1
}else{
dp[i][j] = dp[i][j - 1]