-
-
Save darkash/0cf9ab4045c426841a1de4d354e480b8 to your computer and use it in GitHub Desktop.
AoC 2020 (Day 1)
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
input = %w[1721 | |
979 | |
366 | |
299 | |
675 | |
1456].map(&:to_i) | |
first_num = input.find { |x| input.include?(2020 - x) } | |
second_num = 2020 - first_num | |
first_num * second_num |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment