Loading problem…
Given a string s and a dictionary of words wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.
Implement:
function wordBreak(s, wordDict) {}wordBreak('leetcode', ['leet', 'code']);
// true
wordBreak('catsandog', ['cats', 'dog', 'sand', 'and', 'cat']);
// false