Dynamic Programming21 sections · 916 units
Open in Course

Quiz: LPS Transition

Understanding the recurrence

Check Your Understanding

In Longest Palindromic Subsequence, what is the transition when s[i] equals s[j]?

  1. A.dp[i][j] = max(dp[i+1][j], dp[i][j-1])
  2. B.dp[i][j] = dp[i+1][j-1]
  3. C.dp[i][j] = dp[i+1][j-1] + 2
  4. D.dp[i][j] = dp[i-1][j-1] + 1
Start the roadmap to answer the quizzes and solve the challenges