Mental Model
We want to check if a string can be split into valid words from a dictionary. We try breaking the string 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 sentence without spaces and a list of known words. You try to put spaces in different places to see if the sentence can be made up of those known words only.
s = "leetcode"
Dictionary = {"leet", "code"}
[ l e e t c o d e ]
↑ start
Try splitting:
[leet] + [code]
Both in dictionary -> success