The explanation in the video is difficult to understand. Please explain the dp states to me with the help of an example.
Alyona and strings dp
I’ll go step by step, so keep on following with me.
dp[i][j][k][continue] is our overall dp
Now, dp[i][j][k][0] = maximum sum of (p1 + p2 + p3 + … + pk), upto ith position in string a and jth position in string b and that we have ended
dp[i][j][k][1] = maximum sum of (p1 + p2 + p3 + … + pk), upto ith position in string a and jth position in string b and that we have not yet ended (i.e., we are still continuing the last pk)
My dp is slightly different from that in video. But, you can get the idea in video once you get my idea.
If you want to know the one in video, tell me, I’ll explain only that then.