aoc
/
2022
1
0
Fork 0

Initial commit

This commit is contained in:
Sijmen 2022-12-01 15:48:20 +01:00
commit c1db9c86f1
Signed by: vijfhoek
GPG Key ID: DAF7821E067D9C48
1 changed files with 5 additions and 0 deletions

5
day01.rb Normal file
View 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}"