aboutsummaryrefslogtreecommitdiff
path: root/challenge-096
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-096')
-rwxr-xr-xchallenge-096/abigail/node/ch-1.js1
-rwxr-xr-xchallenge-096/abigail/node/ch-2.js4
2 files changed, 3 insertions, 2 deletions
diff --git a/challenge-096/abigail/node/ch-1.js b/challenge-096/abigail/node/ch-1.js
index 994c1e1971..c8774fd31f 100755
--- a/challenge-096/abigail/node/ch-1.js
+++ b/challenge-096/abigail/node/ch-1.js
@@ -15,3 +15,4 @@ require ('readline')
. split (/\s+/) // Split on white space
. reverse () // Reverse the words
. join (" "))) // And join them again.
+;
diff --git a/challenge-096/abigail/node/ch-2.js b/challenge-096/abigail/node/ch-2.js
index a9618414a3..c40250852b 100755
--- a/challenge-096/abigail/node/ch-2.js
+++ b/challenge-096/abigail/node/ch-2.js
@@ -13,7 +13,7 @@
. toString () // Turn it into a string.
. split ("\n") // Split on newlines.
. filter (_ => _ . length) // Filter out empty lines.
-. map (_ => console . log (LevenshteinDistance (_ . trim ()
+. map (_ => console . log (LevenshteinDistance (_ . trim ()
. split (/\s+/))))
;
@@ -35,7 +35,7 @@ function LevenshteinDistance (strings) {
for (let i = 0; i <= N; i ++) {
distance [i] = [];
for (let j = 0; j <= M; j ++) {
- distance [i] [j] =
+ distance [i] [j] =
i == 0 || j == 0 ? i + j
: Math . min (distance [i - 1] [j] + 1,
distance [i] [j - 1] + 1,