Modify Levenshtein-Distance to ignore order
问题 I'm looking to compute the the Levenshtein-distance between sequences containing up to 6 values. The order of these values should not affect the distance. How would I implement this into the iterative or recursive algorithm? Example: # Currently >>> LDistance('dog', 'god') 2 # Sorted >>> LDistance('dgo', 'dgo') 0 # Proposed >>> newLDistance('dog', 'god') 0 'dog' and 'god' have the exact same letters, sorting the strings before hand will return the desired result. However this doesn't work all