Does not allocate GC memory.
levenshteinDistance
fn
size_t levenshteinDistance(alias equals = (a, b) => a == b, Range1, Range2)(Range1 s, Range2 t) if (isForwardRange!(Range1) && isForwardRange!(Range2))Returns the Levenshtein distance between s and t. The Levenshtein distance computes the minimal amount of edit operations necessary to transform s into t. Performs s.length * t.length evaluations of equals and occupies min(s.length, t.length) storage.
Parameters
equals | The binary predicate to compare the elements of the two ranges. |
s | The original range. |
t | The transformation target |
Returns
The minimal number of edits to transform s into t.
fn
size_t levenshteinDistance(alias equals = (a, b) => a == b, Range1, Range2)(auto ref Range1 s, auto ref Range2 t) if (isConvertibleToString!Range1 || isConvertibleToString!Range2)ditto