mirror of
https://github.com/Threnklyn/advent-of-code-go.git
synced 2026-05-18 19:13:27 +02:00
2.9 KiB
2.9 KiB
Advent of Code 2019
Language: GoLang. https://adventofcode.com/2019
Summary of Days
| Day | Name | Type of Algo & Notes |
|---|---|---|
| 1 | The Tyranny of the Rocket Equation | - Simple math problem |
| 2 | Program Alarm | - Intro to the crazy Intcode problems that are half the AoC days... - Array (slice...) manipulation - I used recursion |
| 3 | Crossed Wires | - Geometry kind of algo, finding intersections of lines on a grid |
| 4 | Secure Container | - May appear math-y, but it's really a string manipulation problem |
| 5 | Sunny with a Chance of Asteroids | - Yay more Intcode!........ - This gave me fits... - Good application for recursion (in my opinion) |
| 6 | Universal Orbit Map | - Tree traversal and depth calculations. It's not quite a Graph, but it has a directed graph algo feel too |
| 7 | Amplification Circuit | - More Intcode... Piping together multiple Intcode computers 😳😳😳 - Refactored Intcode computer to an OOP approach so a single computer maintains its data - Also requires making permutations generator - Some gymnastics to make this circular, but its easier with this OOP approach and the "objects"/instances of a struct maintaining their own data - Concurrency could be used to sync these Amps together... |
| 8 | Space Image Format | 3D Array manipulation, pretty straight forward |
| 9 | Sensor Boost | MORE INTCODE. YAYY 🙃 - A new parameter mode and opcode. - Really feeling the (tech) debt of some earlier design choices here, went back to refactor day07 before jumping into this one, then it was a small bit of code for the relative param/opcode & resizing computer memory if necessary |
| 10 | Monitoring Station | - This (part2) is my favorite algo... Yes I have a favorite algo Fundamentally it's a geometry problem, angles and trig - Part 1: Calculated via slopes - Part 2: Using Arctangent to find angles an asteroid makes against a vertical line from the home base asteroid. Then those angles can be used to determine if Asteroids are covering each other, AND iterating through all of them can find the next angle Asteroid to vaporize |
| 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 |