?>


Coding Challenge: Find the Levenshtein Distance between two strings.
Posted: Posted October 8th
Edited October 8th by Ghowilo
View Source Report Thread Views

Given two strings, determine the Levenshtein Distance between them. The Levenshtein Distance is defined as the minimum number of edits (insertion, deletion, or substitution) needed to change one string to the other.

Example 1: Benyam and Ephrem have a Levenshtein Distance of 5. Simply 5 substitutions.

Example 2: Kitten and Sitting have a Levenshtein Distance of 3. Add a g to the end of Kitten, making it Kitteng, substitute the e with an i making it Kitting, and substitute the K with an S making it Sitting.

Try to do it without looking at my solution first.



There are 1 Replies

insertion, deletion, or substitution


You might want to define what those terms actually mean for other audiences.

Example 1: Benyam and Ephrem have a Levenshtein Distance of 5. Simply 5 substitutions.


Alternately, you can do three substitutions, an insert and a delete.

Given two strings, determine the Levenshtein Distance between them




Building an algorithm looks like it would be a fun side challenge so I'll do that soon as well.

Posted October 8th by Xhin
View Source Quote Report
Xhin
Ground's what's around
Reply to: Coding Challenge: Find the Levenshtein Distance between two strings.
Enter your message here

Rules | Report Issue | Request Feature | Roadmap Facebook Page
GTX0 © 2009-2019 Xhin GameTalk © 1999-2008 lives on
You are not forgotten, Kevin, Liane, Norma, Jason, and Garrett