LeetCode139.单词拆分(动态规划——附图分析)

题目描述

给你一个字符串 s 和一个字符串列表 wordDict 作为字典。请你判断是否可以利用字典中出现的单词拼接出 s 。
注意:不要求字典中出现的单词全部都使用,并且字典中的单词可以重复使用。


来源:力扣(LeetCode)
链接:https://leetcode-cn.com/problems/word-break

示例 1:
输入: s = "leetcode", wordDict = ["leet", "code"]
输出: true
解释: 返回 true 因为 "leetcode" 可以由 "leet""code" 拼接成。

示例 3:
输入: s = "catsandog", wordDict = ["cats", "dog", "sand", 

你可能感兴趣的:(LeetCode,leetcode)