Skip to content

Instantly share code, notes, and snippets.

@darkash
Created December 16, 2020 12:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darkash/0cf9ab4045c426841a1de4d354e480b8 to your computer and use it in GitHub Desktop.
Save darkash/0cf9ab4045c426841a1de4d354e480b8 to your computer and use it in GitHub Desktop.
AoC 2020 (Day 1)
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