Levenshtein Distance
Details
The Levenshtein distance is the minimum number of single character edits that are needed to transform one word into another. The available edits are deletion, insertion, or substitution of a single character.
For example the Levenshtein distance between “shine” and “train” is 4:
- shine → shin (deletion of 'e')
- shin → tshin (insertion of 't')
- tshin → trhin (substitution of 's' for 'r')
- trhin → train (substitution of 'h' for 'a')
For each pair of words per argument, print the Levenshtein distance on its own line.
0 bytes, 0 chars
Restore solution
Compiled from
AT&T syntax to x86-64 Linux. Use
syscalls to write output.
Fennel is an experimental language, no solutions will be saved.
Please leave feedback on the
GitHub issue.
ctrl + enter or