Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solve Day 01 #2

Merged
merged 10 commits into from
Dec 1, 2020
Merged

Solve Day 01 #2

merged 10 commits into from
Dec 1, 2020

Conversation

manuphatak
Copy link
Owner

@manuphatak manuphatak commented Dec 1, 2020

Day 1: Report Repair

After saving Christmas five years in a row , you've decided to take a vacation at a nice resort on a tropical island. Surely , Christmas will go on without you.

The tropical island has its own currency and is entirely cash-only. The gold coins used there have a little picture of a starfish; the locals just call them stars . None of the currency exchanges seem to have heard of them, but somehow, you'll need to find fifty of these coins by the time you arrive so you can pay the deposit on your room.

To save your vacation, you need to get all fifty stars by December 25th.

Collect stars by solving puzzles. Two puzzles will be made available on each day in the Advent calendar; the second puzzle is unlocked when you complete the first. Each puzzle grants one star . Good luck!

Before you leave, the Elves in accounting just need you to fix your expense report (your puzzle input); apparently, something isn't quite adding up.

Specifically, they need you to find the two entries that sum to 2020 and then multiply those two numbers together.

For example, suppose your expense report contained the following:

1721
979
366
299
675
1456

In this list, the two entries that sum to 2020 are 1721 and 299 . Multiplying them together produces 1721 * 299 = 514579 , so the correct answer is _514579_ .

Of course, your expense report is much larger. Find the two entries that sum to 2020 ; what do you get if you multiply them together?

Part Two

The Elves in accounting are thankful for your help; one of them even offers you a starfish coin they had left over from a past vacation. They offer you a second one if you can find three numbers in your expense report that meet the same criteria.

Using the above example again, the three entries that sum to 2020 are 979 , 366 , and 675 . Multiplying them together produces the answer, _241861950_ .

In your expense report, what is the product of the three entries that sum to 2020 ?

Link

https://adventofcode.com/2020/day/1

@codecov-io
Copy link

codecov-io commented Dec 1, 2020

Codecov Report

Merging #2 (cbd2344) into main (859ac26) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main        #2   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         2    +1     
  Lines            2         8    +6     
=========================================
+ Hits             2         8    +6     
Impacted Files Coverage Δ
src/Template/Solution.hs 100.00% <ø> (ø)
src/Day01/Solution.hs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 859ac26...cbd2344. Read the comment docs.

@manuphatak manuphatak self-assigned this Dec 1, 2020
@manuphatak manuphatak merged commit 97f3333 into main Dec 1, 2020
@manuphatak manuphatak deleted the day_01 branch December 1, 2020 08:26
@manuphatak manuphatak added the solution A solution to a problem label Dec 12, 2020
@manuphatak manuphatak changed the title Solve Day 1 Solve Day 01 Dec 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
solution A solution to a problem
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants