aboutsummaryrefslogtreecommitdiff
path: root/challenge-134/abigail/ruby/ch-2.rb
diff options
context:
space:
mode:
Diffstat (limited to 'challenge-134/abigail/ruby/ch-2.rb')
-rw-r--r--challenge-134/abigail/ruby/ch-2.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/challenge-134/abigail/ruby/ch-2.rb b/challenge-134/abigail/ruby/ch-2.rb
new file mode 100644
index 0000000000..17c9d79acf
--- /dev/null
+++ b/challenge-134/abigail/ruby/ch-2.rb
@@ -0,0 +1,21 @@
+#!/usr/bin/ruby
+
+#
+# See ../README.md
+#
+
+#
+# Run as: ruby ch-2.rb < input-file
+#
+
+ARGF . each_line do
+ |line|
+ n, m = line . split
+ seen = {}
+ for i in 1 .. n . to_i do
+ for j in 1 .. m . to_i do
+ seen [i * j] = 1
+ end
+ end
+ puts (seen . size)
+end