leetcode, LC11: word-break-ii

1 题目描述 给定一个字符串s和一组单词dict,在s中添加空格将s变成一个句子,使得句子中的每个单词都是dict中的单词 返回全部可能的结果 例如:给定的字符串s =“catsanddog”, dict =[“cat”, “cats”, “and”, “sand”, “dog”]. 返回的结果为[“cats and dog”, “cat sand dog”].web Given a string
相关文章
相关标签/搜索