String DP

Advanced · 24 min read · Problem-Solving Patterns, Dynamic Programming

Two strings, two indexes: LCS, edit distance and palindromes.

This is an Advanced lesson, part of Premium. What it covers:

  • The recipe
  • Longest common subsequence
  • Edit distance — three operations, three neighbours
  • Counting variants
  • One string: palindromes
  • Transition cheat sheet
  • Practice ladder
  • Interview questions
  • Further reading

Previous: Grid DP · Next: Tree & Interval DP