diff --git a/problems/0139.单词拆分.md b/problems/0139.单词拆分.md index c6d8e43b..46ed641e 100644 --- a/problems/0139.单词拆分.md +++ b/problems/0139.单词拆分.md @@ -254,7 +254,25 @@ Python: Go: - +```Go +func wordBreak(s string,wordDict []string) bool { + wordDictSet:=make(map[string]bool) + for _,w:=range wordDict{ + wordDictSet[w]=true + } + dp:=make([]bool,len(s)+1) + dp[0]=true + for i:=1;i<=len(s);i++{ + for j:=0;j \ No newline at end of file +