-
-
Notifications
You must be signed in to change notification settings - Fork 805
Closed
Labels
Description
Hi, I've been always NOT understanding LCS & DP in general. In the LCS explanation, these sentences
If we throw
A, our LCS length will bedp[i - 1][j](since we have prefixesS[1..i - 1]andT[1..j]). If we try to throwBcharacter, we will have prefixesS[1..i]andT[1..j - 1]so the length of LCS will bedp[i][j - 1].
seem to claim that dp[i][j] = dp[i - 1][j] = dp[i][j - 1], which is not the case.
Can we have a better explanation?