Given a non-emptystring s anda dictionary wordDict containing a list of non-emptywords, determine if s can be segmented intoaspace-separated sequence ofoneor more dictionary words. You may assume the dictionary does not contain duplicate words.
For example, given
s = "leetcode",
dict = ["leet", "code"].
Return true because "leetcode" can be segmented as"leet code".
UPDATE (2017/1/4):
The wordDict parameter had been changed toa list of strings (instead ofasetof strings). Please reload the code definition togetthe latest changes.