[2018][ruby][1.x]
change ulynuyvnpmytmszspnzwkqpxkstkupmq
commit 599702c24fc56980b50c67869d153df9382cce3e
author Alpha Chen <alpha.chen@gmail.com>
date
parent qvuxytxp
diff --git a/2018/ruby/day_01.rb b/2018/ruby/day_01.rb
new file mode 100644
index 0000000..0594765
--- /dev/null
+++ b/2018/ruby/day_01.rb
@@ -0,0 +1,8 @@
+require "set"
+
+seen = Set.new
+ARGF.read.lines.map(&:to_i).cycle.each.with_object([0]) do |i,n|
+  n[0] += i
+  p n[0] and exit if seen.include?(n[0])
+  seen << n[0]
+end