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

6 lines
163 B
Ruby

input = STDIN.read.split "\n\n"
elves = input.map { |elf| elf.split("\n").map(&:to_i).sum }.sort
puts "Part 1: #{elves.last}"
puts "Part 2: #{elves.last(3).sum}"