Word Break
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.
Word Break

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.

Example 1:
Input: {"s":"leetcode","wordDict":["leet","code"]}
Output: true
Input
arr ={"s":"leetcode","wordDict":["leet","code"]}

Init DP array

l

1

e

2

e

3

t

4

c

5

o

6

d

7

e

8
DP:
0
1
2
3
4
5
6
7
8
leet
code
Variables
VariableValue
i8
DepthFunction Call
Stack empty
0/41