Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words. The same dictionary word may be reused multiple times.
Example:
Input: s = "pineapple", wordDict = ["pine","apple"]
Output: true
Explanation: "pineapple" can be segmented as "pine apple".
Constraints:
1 <= s.length <= 3001 <= wordDict.length <= 10001 <= wordDict[i].length <= 20