Retired

DP - Edit Distance (retired)

Description:

Edit distance is the minimum number of steps to get from one word to another.

A step is defined by:

  1. Deletion of one character anywhere in the string
  2. Insertion of one character anywhere in the string
  3. Replacement of one character anywhere in the string

For example, EditDistance("sunday", "saturday") could resolve in the following way:

  1. sunday -> surday
  2. surday -> sturday
  3. sturday -> saturday

resulting in a minumum edit distance of 3, as that is the minimum amount of steps.

Write a function that takes in the two words and returns the edit distance, and is efficient enough only to not timeout. (Brute force solution is acceptable)

Algorithms
Dynamic Programming
Programming Paradigms

Stats:

CreatedMar 26, 2017
Warriors Trained75
Total Skips3
Total Code Submissions56
Total Times Completed15
JavaScript Completions15
Total Stars0
% of votes with a positive feedback rating40% of 10
Total "Very Satisfied" Votes3
Total "Somewhat Satisfied" Votes2
Total "Not Satisfied" Votes5
Total Rank Assessments11
Average Assessed Rank
5 kyu
Highest Assessed Rank
3 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • Bkucera Avatar
  • kazk Avatar
Ad