I need to find a dynamic programming algorithm to solve this problem. I tried but couldn\'t figure it out. Here is the problem:
You are given a string of n character
The O(N^2) Dp is clear but if you know the words of the dictionary, i think you can use some precomputations to get it even faster in O(N). Aho-Corasick
O(N^2)
O(N)