Given a string s and a dictionary of words, return true if s can be segmented into a space-separated sequence of one or more dictionary words (words may be reused).
Input
sOutput: true or false.
leetcode leet code
true
applepenapple apple pen
true
catsandog cats dog sand and cat
false
Run your code against the sample tests, or Submit to run the full suite.