NumPy allowed · plain Python earns 10 bonus points
Measure string similarity using the classical Wagner-Fischer dynamic programming edit distance.
Implement edit_distance(word1, word2): calculate the minimum number of operations (insert a character, delete a character, replace a character) needed to transform word1 into word2.
edit_distance(word1: str, word2: str) -> int