aboutsummaryrefslogtreecommitdiff
path: root/challenge-134/abigail/node/ch-2.js
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-134/abigail/node/ch-2.js')
-rw-r--r--challenge-134/abigail/node/ch-2.js22
1 files changed, 22 insertions, 0 deletions
diff --git a/challenge-134/abigail/node/ch-2.js b/challenge-134/abigail/node/ch-2.js
new file mode 100644
index 0000000000..ae1d561c97
--- /dev/null
+++ b/challenge-134/abigail/node/ch-2.js
@@ -0,0 +1,22 @@
+#!/usr/local/bin/node
+
+//
+// See ../README.md
+//
+
+//
+// Run as: node ch-2.js < input-file
+//
+
+ require ('readline')
+. createInterface ({input: process . stdin})
+. on ('line', line => {
+ let [n, m] = line . trim () . split (" ") . map (x => +x)
+ let seen = {}
+ for (let i = 1; i <= n; i ++) {
+ for (let j = 1; j <= m; j ++) {
+ seen [i * j] = 1
+ }
+ }
+ console . log (Object . keys (seen) . length)
+})