Merge pull request #927 from sQVe/fix/repair-levenshtein-distance

[FIX] Repair levenshtein distance code block
This commit is contained in:
Angelos Chalaris
2019-02-28 20:01:51 +02:00
committed by GitHub

View File

@ -5,7 +5,7 @@ Calculates the [Levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_
Calculates the number of changes (substitutions, deletions or additions) required to convert `string1` to `string2`.
Can also be used to compare two strings as shown in the second example.
``` js
```js
const levenshteinDistance = (string1, string2) => {
if (string1.length === 0) return string2.length;
if (string2.length === 0) return string1.length;