From 34ce71c8b6f5eb35cb015a0476f2b47e56f18bd5 Mon Sep 17 00:00:00 2001 From: Alpha Chen Date: Mon, 5 Dec 2022 21:20:53 -0800 Subject: [PATCH] [2022][ruby][6.x] --- 2022/ruby/day_06.rb | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 2022/ruby/day_06.rb diff --git a/2022/ruby/day_06.rb b/2022/ruby/day_06.rb new file mode 100644 index 0000000..46442ac --- /dev/null +++ b/2022/ruby/day_06.rb @@ -0,0 +1,2 @@ +# p ARGF.read.chars.each_cons(4).with_index.find {|a,i| a.uniq.size == 4 }.last + 4 +p ARGF.read.chars.each_cons(14).with_index.find {|a,i| a.uniq.size == 14 }.last + 14