🎙 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 5 of 10

What is the difference between a subsequence and a substring?

What is the difference between a subsequence and a substring?

  1. A.A subsequence keeps order but may skip letters; a substring must be continuous
  2. B.There is no difference
  3. C.A substring may skip letters; a subsequence cannot
  4. D.A subsequence must be a palindrome
Answer & explanation

Correct answer: A subsequence keeps order but may skip letters; a substring must be continuous

That is why longest common substring resets to 0 on a mismatch, while LCS takes max(up, left).

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 →