dp[i] = true if s[0..i-1] can be segmented. For each position i, check all possible last words. If s[j..i-1] is in the dictionary and dp[j] is true, then dp[i] is true. Base case: dp[0] = true (empty string is segmentable). Use a set for O(1) dictionary lookup.
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
$ curl repovive.com/roadmaps/maang-interview-prep/dynamic-programming/word-break-hint
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░█████████████████████████████████████████████████████████████████████████████████████