🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.Delete
  2. B.Insert
  3. C.No operation
  4. 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 →