Welcome back to week nine of the weekly programming contests! If you are new to the contest or need a refresher don’t forget to read up on the rules and information Posted Here
This weeks challenge is to implement the method public static int lev(String s1, String s2)
(the method and vars can be renamed). This method returns the Levenshtein Distance of the two method parameters. Read the link if you don’t know what levenshtein distance is.
Copied from Wikipedia:
The Levenshtein distance between two words is the minimum number of single-character edits (i.e. insertions, deletions or substitutions) required to change one word into the other
Examples:
lev("fluff", "puff") -> 2 lev("hello", "goodbye") -> 7 lev("harry", "potter") -> 6 lev("mill", "bill") -> 1 lev("death", "smiles") -> 6 lev("blood", "red") -> 4 lev("ghost", "protocol") -> 7 lev("iron", "man") -> 3 lev("sponge", "powered") -> 5
Imports are allowed for this challenge!
Challenge Closes: Sunday 1/3/16
Good luck!