parent
85d7e21ad7
commit
54c626efc3
@ -0,0 +1,9 @@
|
||||
input = DATA.read
|
||||
.gsub(/don't\(\)(?~do\(\))do\(\)/, "") # part two
|
||||
.scan(/mul\((\d+),(\d+)\)/)
|
||||
.map { _1.map(&:to_i) }
|
||||
|
||||
pp input.sum { _1 * _2 }
|
||||
|
||||
__END__
|
||||
xmul(2,4)&mul[3,7]!^don't()_mul(5,5)+mul(32,64](mul(11,8)undo()?mul(8,5))
|
Loading…
Reference in new issue