Edit Distance — 3 operations: insert, delete, replace.
dp[i][j] = min edits to convert A[0..i-1]B[0..j-1]:
Longest Palindromic Subsequence:
dp[i][j] = LPS length of s[i..j]:
  If s[i]==s[j]: dp[i][j] = dp[i+1][j-1] + 2
  Else: dp[i][j] = max(dp[i+1][j], dp[i][j-1])
Filled
Current
Sources
Match / Optimal

Controls


Time: O(m·n) | Space: O(m·n)

Steps

0 steps

Press Run to trace the algorithm one step at a time.