Coding Test

Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences.

Input: s = “kaiosinc”, wordDict = [“kaios”, “inc”]

Output: true

Input: s = "catsandog", wordDict = ["cats", "dog", "sand", "and", "cat"]

Output: false