commit c1db9c86f1c8ae78701d7423e3ff167037661047 Author: Sijmen Date: Thu Dec 1 15:48:20 2022 +0100 Initial commit 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}"