?>

# Department of Science, Math, & Technology

E = mcï¿½
Coding Challenge: Find the Levenshtein Distance between two strings.
Posted: Posted October 8th
Edited October 8th by Ghowilo
 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. Toggle My SolutionPastebin because GTX0 doesn't seem to like to format code very well. https://pastebin.com/VYauiaJZ
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.