Problem
Given a string s and a list of dictionary words wordDict, add spaces to s so that every resulting word is in the dictionary. Return all such sentences, in any order. A dictionary word may be reused any number of times.
Example 1
s = "catsanddog", wordDict = ["cat", "cats", "and", "sand", "dog"]
Example 2
→ ["cats and dog", "cat sand dog"]
Example 3
s = "catsandog", wordDict = ["cats", "dog", "sand", "and", "cat"]
Example 4
→ []
Constraints
1 <= s.length <= 201 <= wordDict.length <= 10001 <= wordDict[i].length <= 10All the words in wordDict are unique.