Created
December 18, 2020 05:29
-
-
Save jhawthorn/eebff18e7384a05b9194f22cd86e10d8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Integer | |
alias_method :add, :+ | |
alias_method :+, :* | |
alias_method :*, :add | |
end | |
p File.readlines("data/18.txt").map { | |
|l| eval(l.tr("+*", "*+")) | |
}.sum |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment