Define the subproblem by substring
The state is an interval. ex. dp(i,j) represents the substring(i,j)