Something went wrong. Try again.
Code for the Advent of Code event
aoc advent-of-code
Something went wrong. Try again.
182 B · 7 lines
Ruby
at rust
12345678#!/usr/bin/env ruby# frozen_string_literal: true
inventories = ARGF.read.split("\n\n").map { |l| l.split.map(&:to_i).sum }.sort
puts inventories.lastputs inventories.last(3).sum