Calculate the Levenshtein distance between two sequences.