Something went wrong. Try again.
Code for the Advent of Code event
aoc advent-of-code
Something went wrong. Try again.
198 B · 6 lines
Ruby
at rust
1234567#!/usr/bin/env ruby# frozen_string_literal: true
nums = ARGF.readlines.map(&:to_i)puts nums.each_cons(2).count { |a, b| a < b }puts nums.each_cons(3).each_cons(2).count { |a, b| a.sum < b.sum }