Levenshtein distance for arrays