Skip to content

Edit distance

planning ahead

Level 2 of 3

Also called Levenshtein distance and Wagner-Fischer algorithm.

Finds the fewest one-letter edits that turn one word into another, each edit a delete, an insert or a replace. A table holds the answer for every start of the first word against every start of the second, each cell built from the three before it.

edits needed: the first word down the side, the second along the top

cells filled
0

step 1 of 1

Examples

Two words of 1 to 7 letters each, a to z only, separated by a comma or a space, for example seat, eats.