Problem 139 · Medium

Word Break

DP: dp[i] is true if any dp[j] is true and s[j..i-1] is in the dictionary.

Open the interactive visualisation