From c1db9c86f1c8ae78701d7423e3ff167037661047 Mon Sep 17 00:00:00 2001 From: Sijmen Date: Thu, 1 Dec 2022 15:48:20 +0100 Subject: [PATCH] Initial commit --- day01.rb | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 day01.rb diff --git a/day01.rb b/day01.rb new file mode 100644 index 0000000..d2ccb42 --- /dev/null +++ b/day01.rb @@ -0,0 +1,5 @@ +input = STDIN.read.split "\n\n" +elves = input.map { |elf| elf.split("\n").map(&:to_i).sum } + +puts "Part 1: #{elves.max}" +puts "Part 2: #{elves.sort.last(3).sum}"