📚 dsaflash.cards
Problems
Log in
Sign up
Home
/
Dynamic Programming
/
String DP
String DP
Question 1 of 6
In LCS, what happens when characters s1[i-1] and s2[j-1] match vs when they don't?
A
Match: dp[i][j] = max(dp[i-1][j], dp[i][j-1]). No match: dp[i][j] = dp[i-1][j-1] + 1
B
Match: dp[i][j] = dp[i][j-1] + 1. No match: dp[i][j] = dp[i-1][j]
C
Match: dp[i][j] = dp[i-1][j-1] + 1. No match: dp[i][j] = max(dp[i-1][j], dp[i][j-1])
D
Match: dp[i][j] = dp[i-1][j-1] + 1. No match: dp[i][j] = 0
← Back to categories