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:
parent
9889ffdd81
commit
9ca8885fbc
3
ruby/2025/6/bin/problem
Normal file
3
ruby/2025/6/bin/problem
Normal 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
|
||||
Loading…
Reference in New Issue
Block a user