Your question is Word Break. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Uber Eats may need to validate whether a normalized search string can be assembled from known menu or query tokens. Given a string s and a list wordDict, determine whether s can be segmented into one or more dictionary words. A dictionary word may be used multiple times.
Implement word_break(s, wordDict).
s, a lowercase string, and wordDict, a list of lowercase strings.True if s can be fully segmented into dictionary words. Otherwise, return False.def word_break(s, wordDict):