possible sentences
发布于 2022-03-03 16:46:11
Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.
Return all such possible sentences.
输入描述:
s ="catsanddog"
dict ="cat", "cats", "and", "sand", "dog"输入样例: s ="catsanddog" dict ="cat","cats","and","sand","dog" 输出描述: [cats and dog, cat sand dog]输出样例 [cats and dog, cat sand dog]
Return all such possible sentences.
dict ="cat", "cats", "and", "sand", "dog"输入样例: s ="catsanddog" dict ="cat","cats","and","sand","dog" 输出描述: [cats and dog, cat sand dog]输出样例 [cats and dog, cat sand dog]
关注者
0
被浏览
11