Edit Distance DP Problem

  1. characters are same, so we do nothing
  2. Characters are different, so we do substitution
  3. Characters are different, so we do insertion
  4. Characters are different, so we do deletion
Dp table for edit distance
Implementation of Edit distance
Code with improved space complexity

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store