We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4d7cd29 commit bf068ccCopy full SHA for bf068cc
problems/0392.判断子序列.md
@@ -203,6 +203,25 @@ const isSubsequence = (s, t) => {
203
};
204
```
205
206
+Go:
207
+```go
208
+func isSubsequence(s string, t string) bool {
209
+ dp := make([][]int,len(s)+1)
210
+ for i:=0;i<len(dp);i++{
211
+ dp[i] = make([]int,len(t)+1)
212
+ }
213
+ for i:=1;i<len(dp);i++{
214
+ for j:=1;j<len(dp[i]);j++{
215
+ if s[i-1] == t[j-1]{
216
+ dp[i][j] = dp[i-1][j-1] +1
217
+ }else{
218
+ dp[i][j] = dp[i][j-1]
219
220
221
222
+ return dp[len(s)][len(t)]==len(s)
223
+}
224
+```
225
226
227
0 commit comments