aoc_omni/ruby/2025/6/lib/cephalopod_math.rb
2025-12-06 06:16:20 -05:00

19 lines
349 B
Ruby

class CephalopodMath
attr_reader :worksheet
def initialize(worksheet)
@worksheet = worksheet
end
def self.for(input)
new input
end
def wide_columns
worksheet.split("\n").map(&:split).transpose
end
def wide_column_answers
wide_columns.map{ |column| column[..-2].map(&:to_i).reduce(&(column[-1]).to_sym) }
end
end