Given a string and dictionary of words, determine if the string is valid based on all the dictionary words. Also seen as: 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. Note that the same word in the dictionary may be reused multiple times in the segmentation. Ext: Determine if the given string contains valid words while ignoring extraneous characters.
Book mock interviews with engineers from Google, Facebook, Amazon, or other top companies. Get detailed feedback on exactly what you need to work on. Everything is anonymous, and you don't have to until you find a job.