2025 ruby day 6 part one

This is the fastest I've ever solved one of these problems.
This took me about one minute and two tries
(the first try I didn't use #to_sym on p[-1])
I'm chuffed
This commit is contained in:
Bill Rossi 2025-12-06 06:03:45 -05:00
parent 9889ffdd81
commit 9ca8885fbc

3
ruby/2025/6/bin/problem Normal file
View File

@ -0,0 +1,3 @@
#!/usr/bin/env ruby
puts STDIN.read.chomp.split("\n").map(&:split).transpose.map { |p| p[..-2].map(&:to_i).reduce(&(p[-1]).to_sym) }.sum