← Quiz: DP on Grids and Strings: all 10 questions
Quiz: DP on Grids and Strings · Question 7 of 10
In the edit distance recurrence, dp[i − 1][j − 1] + 1 stands for which operation?
In the edit distance recurrence, dp[i − 1][j − 1] + 1 stands for which operation?
- A.Delete
- B.Insert
- C.No operation
- D.Replace
Answer & explanation
Correct answer: Replace
Replace a[i − 1] with b[j − 1]; then both prefixes are one letter shorter.
Can you get the rest right without peeking?
Take the timed Quiz: DP on Grids and Strings quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →