Last active
December 2, 2022 13:03
-
-
Save samuelpath/65e2ad3e361e36b8ccd6d21e2cb065ac to your computer and use it in GitHub Desktop.
This file contains hidden or 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
results = {"A X" => [4, 3], "B X" => [1, 1], "C X" => [7, 2], | |
"A Y" => [8, 4], "B Y" => [5, 5], "C Y" => [2, 6], | |
"A Z" => [3, 8], "B Z" => [9, 9], "C Z" => [6, 7]} | |
| |
sum_part_1 = lines.sum { |line| results[line][0] } | |
sum_part_2 = lines.sum { |line| results[line][1] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment