Mental Model
We want to check if a sentence can be split into valid words from a dictionary. We try breaking the sentence at every position and see if the left part is a word and the right part can also be split similarly.
Analogy: Imagine you have a long chain of beads and a box of smaller bead groups. You want to see if you can break the long chain into smaller groups exactly matching the groups in the box.
sentence: w o r d b r e a k dictionary: [word, break, problem] Check splits: word | breakproblem wordbreak | problem wordbreakproblem Try to find valid splits step by step.