Computes the Levenshtein distance between two input strings.