Initial commit
This commit is contained in:
commit
c1db9c86f1
1 changed files with 5 additions and 0 deletions
5
day01.rb
Normal file
5
day01.rb
Normal file
|
@ -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}"
|
Loading…
Reference in a new issue