给定一个非空字符串 s 和一个包含非空单词列表的字典 wordDict,在字符串中增加空格来构建一个句子,使得句子中所有的单词都在词典中。返回所有这些可能的句子
说明:
输入:
s = "catsanddog" wordDict = ["cat", "cats", "and", "sand", "dog"]
输出:
[ "cats and dog", "cat sand dog" ]
https://leetcode-cn.com/probl...
548k questions
547k answers
4 comments
86.3k users