From 10794e411f89eca000326d64b1c86f5a8a789bc2 Mon Sep 17 00:00:00 2001 From: Jeff Yates Date: Sun, 6 Dec 2020 08:11:51 -0500 Subject: [PATCH] finished solution 1 --- day06/solution01.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 day06/solution01.rb diff --git a/day06/solution01.rb b/day06/solution01.rb new file mode 100755 index 0000000..87df7e0 --- /dev/null +++ b/day06/solution01.rb @@ -0,0 +1,10 @@ +#!/bin/env ruby + +text = File.read('./input').split("\n\n") + +text.map! do |t| + t.delete("\n").split('').uniq.reduce(:+) +end +size = text.map { |t| t.length }.reduce(:+) + +p size \ No newline at end of file