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}"
|