From bcbe60834cdee6435ab0b20189b42cdfd0f376a2 Mon Sep 17 00:00:00 2001 From: Alex Chao Date: Tue, 4 Aug 2020 16:17:08 -0400 Subject: [PATCH] added day14 part2 prompt --- README.md | 3 ++- day14/prompt.txt | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 339ab41..5f666c8 100644 --- a/README.md +++ b/README.md @@ -19,4 +19,5 @@ Day | Name | Type of Algo & Notes 11 | Space Police | - More Intcode stuff...
- __2D Array/Slice manipulation__ and a bit of maths/graphing
- Implemented a __RotateGrid__ algo 12 | The N-Body Problem | I like to call this a _(harmonic) frequency_ algo. Finding the harmonic frequency of multiple bodies/items and then finding the Least Common Multiple of those frequencies will tell you when all the bodies have returned to their initial state.
- I've used this approach for a leetcode problem about prisoners in jail cells too 13 | Care Package | Intcode again! It's basically every other day...
- part1: 2D array manipulation again
- part2: holy algo, some logic to basically play Bricks game.
- This is more of a design question for how you manage state -14 | Space Stoichiometry | __Weighted Graph and Breadth First Traversals__
- Because not all of the products have a quantity of 1, it complicates the graph's data model. I ended up mapping the product/chemical name to a map of its stoichiometry where the product's number is positive & reactants were negative.
- part2: not just a simple division because of "extra byproducts" of generating each piece of fuel. I just let this brute force thing run for ~30 seconds... \ No newline at end of file +14 | Space Stoichiometry | __Weighted Graph and Breadth First Traversals__
- Because not all of the products have a quantity of 1, it complicates the graph's data model. I ended up mapping the product/chemical name to a map of its stoichiometry where the product's number is positive & reactants were negative.
- part2: not just a simple division because of "extra byproducts" of generating each piece of fuel. I just let this brute force thing run for ~30 seconds... +15 | Oxygen System | YAY INTCODE 🙄
diff --git a/day14/prompt.txt b/day14/prompt.txt index c5df92b..1dc58a4 100644 --- a/day14/prompt.txt +++ b/day14/prompt.txt @@ -82,3 +82,25 @@ Here are some larger examples: 7 XCVML => 6 RJRHP 5 BHXH, 4 VRPVC => 5 LTCX Given the list of reactions in your puzzle input, what is the minimum amount of ORE required to produce exactly 1 FUEL? + +Your puzzle answer was 1185296. + +--- Part Two --- +After collecting ORE for a while, you check your cargo hold: 1 trillion (1000000000000) units of ORE. + +With that much ore, given the examples above: + +The 13312 ORE-per-FUEL example could produce 82892753 FUEL. +The 180697 ORE-per-FUEL example could produce 5586022 FUEL. +The 2210736 ORE-per-FUEL example could produce 460664 FUEL. +Given 1 trillion ORE, what is the maximum amount of FUEL you can produce? + +Your puzzle answer was 1376631. + +Both parts of this puzzle are complete! They provide two gold stars: ** + +At this point, you should return to your Advent calendar and try another puzzle. + +If you still want to see it, you can get your puzzle input. + +You can also [Share] this puzzle. \ No newline at end of file