aoc
/
2022
1
0
Fork 0
2022/day01.rb

6 lines
163 B
Ruby
Raw Permalink Normal View History

2022-12-01 14:48:20 +00:00
input = STDIN.read.split "\n\n"
2022-12-01 14:53:39 +00:00
elves = input.map { |elf| elf.split("\n").map(&:to_i).sum }.sort
2022-12-01 14:48:20 +00:00
2022-12-01 14:53:39 +00:00
puts "Part 1: #{elves.last}"
puts "Part 2: #{elves.last(3).sum}"