Dynamic Programming21 sections · 916 units
Open in CourseQuiz: LPS Transition
Understanding the recurrence
Check Your Understanding
In Longest Palindromic Subsequence, what is the transition when s[i] equals s[j]?
- A.dp[i][j] = max(dp[i+1][j], dp[i][j-1])
- B.dp[i][j] = dp[i+1][j-1]
- C.dp[i][j] = dp[i+1][j-1] + 2
- D.dp[i][j] = dp[i-1][j-1] + 1