Skip to content

Commit dbbe4f7

Browse files
committed
Updated README: added table of contents and screenshot of completed calendar
1 parent 1e45374 commit dbbe4f7

File tree

2 files changed

+44
-12
lines changed

2 files changed

+44
-12
lines changed

README.md

Lines changed: 44 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,51 @@
11
# 🌟 Advent of Code 2020 🎄
22

3-
This repository contains coding developed for the **Advent of Code 2020** event.
4-
5-
## What is `Advent of Code`?
6-
7-
[Advent of Code](http://adventofcode.com) is an online event created by [Eric Wastl](https://twitter.com/ericwastl). It consists of *"an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other."* - source: https://adventofcode.com/about
3+
*My Python solutions for **Advent of Code 2020**.*
4+
5+
## Contents
6+
7+
| DAY | TITLE | PUZZLE SUMMARY
8+
| :-: | :- | :-
9+
| [📁 01](day_01) | **Report Repair** | 📃 **Input:** expense report - i.e. list of integer numbers.<br />⭐ **Part One:** find the 2 entries (numbers) that sum to 2020, then multiply them together. <br />⭐ **Part Two:** find the 3 entries (numbers) that sum to 2020, then multiply them together.
10+
| [📁 02](day_02) | **Password Philosophy** | 📃 **Input:** list of passwords and the corporate policy when that password was set (e.g. `1-3 a: abcde`).<br />⭐ **Part One:** count how many passwords are valid according to the policies. <br />⭐ **Part Two:** count how many passwords are valid according to the new interpretation of the policies.
11+
| [📁 03](day_03) | **Toboggan Trajectory** | 📃 **Input:** map of open squares (`.`) and trees (`#`).<br />⭐ **Part One:** count how many trees would be encountered when traversing the map with given slope rules. <br />⭐ **Part Two:** same thing as Part One, but for list of various slopes; multiply together the number of trees encountered on each of these slopes.
12+
| [📁 04](day_04) | **Passport Processing** | 📃 **Input:** batch file with passport data.<br />⭐ **Part One:** count how many passports are _valid_ - those that have all required fields. <br />⭐ **Part Two:** count how many passports are _valid_ - those that have all required fields AND valid values.
13+
| [📁 05](day_05) | **Binary Boarding** | 📃 **Input:** list of boarding passes (e.g. `FBFBBFFRLR`).<br />⭐ **Part One:** find the highest _seat ID_ - which is calculated by `row_int * 8 + col_int`. <br />⭐ **Part Two:** find the ID of my seat (which is the only one missing from the list).
14+
| [📁 06](day_06) | **Custom Customs** | 📃 **Input:** answers from customs declaration form collected from every group on the plane.<br />⭐ **Part One:** sum of counts of number of questions to which _anyone_ answered "yes". <br />⭐ **Part Two:** sum of counts of number of questions to which _everyone_ answered "yes".
15+
| [📁 07](day_07) | **Handy Haversacks** | 📃 **Input:** bag rules (for luggage processing).<br />⭐ **Part One:** count how many bag colors can eventually contain at least one `shiny gold` bag. <br />⭐ **Part Two:** count how many individual bags are required inside your single `shiny gold` bag.
16+
| [📁 08](day_08) | **Handheld Halting** | 📃 **Input:** boot code for handheld game console.<br />⭐ **Part One:** get value in the accumulator after one loop of the infinte loop. <br />⭐ **Part Two:** fix the program (correct the infinite loop by changing a single instruction) and get value in the accumulator after program terminates.
17+
| [📁 09](day_09) | **Encoding Error** | 📃 **Input:** data encrypted with the _eXchange-Masking Addition System_ (XMAS) - i.e. list of numbers (integers).<br />⭐ **Part One:** find invalid number - i.e. first number which is _not_ the sum of two of the 25 numbers before it. <br />⭐ **Part Two:** find the encryption weakness - i.e. sum of smallest and largest numbers of contiguous set of at least two numbers which sum to the invalid number.
18+
| [📁 10](day_10) | **Adapter Array** | 📃 **Input:** list of output joltage of adapters - i.e. list of numbers (integers).<br />⭐ **Part One:** count the occurrence of 1-jolt and 3-jolt differences in chain that uses all adapters - i.e. sorted list of numbers - and multiply together these two numbers of occurrence. <br />⭐ **Part Two:** find the total number of distinct ways the adapters can be arranged to connect the charging outlet to the device - i.e. combinatorial analysis of sorted list of numbers.
19+
| [📁 11](day_11) | **Seating System** | 📃 **Input:** map of the seat layout (`.` for floor, `L` for empty seat and `#` for occupied seat) at waiting area to board the ferry.<br />⭐ **Part One:** simulate seating rules repeatedly until no seats change state anymore - i.e. equilibrium is reached; count how many seats end up occupied. <br />⭐ **Part Two:** given the new visibility method and the rule change for occupied seats becoming empty, count how many seats end up occupied when equilibrium is reached.
20+
| [📁 12](day_12) | **Rain Risk** | 📃 **Input:** navigation instructions - i.e. sequence of single-character actions (`N`, `S`, `E`, `W`, `L`, `R`, `F`) paired with integer input values (e.g. `F10`).<br />⭐ **Part One:** figure out where the navigation instructions lead; calculate the _Manhattan distance_ (sum of the absolute values of its east/west position and its north/south position) between that location and the ship's starting position. <br />⭐ **Part Two:** figure out where the navigation instructions _actually_ lead - i.e. with new action meanings; calculate the _Manhattan distance_ between that location and the ship's starting position.
21+
| [📁 13](day_13) | **Shuttle Search** | 📃 **Input:** notes on the shuttle bus service - i.e. two lines: estimate of the earliest timestamp you could depart on a bus; list of bus IDs that are in service according to the shuttle company (`x` entries are out of service).<br />⭐ **Part One:** find ID of the earliest bus you can take to the airport multiplied by the number of minutes you'll need to wait for that bus. <br />⭐ **Part Two:** find the earliest timestamp such that all of the listed bus IDs depart at offsets matching their positions in the list.
22+
| [📁 14](day_14) | **Docking Data** | 📃 **Input:** initialization program - i.e. list of bitmasks (e.g. `mask = XXXXXXXXXXXXXXXXXXXXXXXXXXXXX1XXXX0X`) and pair of memory address with integer input values (e.g. `mem[8] = 11`).<br />⭐ **Part One:** execute the initialization program; sum all values left in memory after it completes. <br />⭐ **Part Two:** execute the initialization program using an emulator for a version 2 decoder chip; sum of all values left in memory after it completes.
23+
| [📁 15](day_15) | **Rambunctious Recitation** | 📃 **Input:** list of starting numbers - i.e. list of comma-separated integers (e.g. `0,3,6`).<br />⭐ **Part One:** play the Elves' memory game and find the `2020`th number spoken. <br />⭐ **Part Two:** play the Elves' memory game and find the `30000000`th number spoken.
24+
| [📁 16](day_16) | **Ticket Translation** | 📃 **Input:** three blocks of data: (1) rules for ticket fields - i.e. list of fields that exist somewhere on the ticket and the valid ranges of values for each field; (2) numbers on your ticket; (3) list of numbers on other nearby tickets for the same train service.<br />⭐ **Part One:** calculate ticket scanning error rate - i.e. sum of all of the invalid values in list of nearby tickets. <br />⭐ **Part Two:** discard invalid tickets in list of nearby tickets; use the remaining valid tickets to determine which field is which; look for the six fields on your ticket that start with the word departure and multiply those six values together.
25+
| [📁 17](day_17) | **Conway Cubes** | 📃 **Input:** initial state of the pocket dimension - i.e. grid with flat region of cubes (`.` for inactive cubes and `#` for active cubes).<br />⭐ **Part One:** simulate the six-cycle boot process in 3-dimensional space; count how many cubes are left in the active state after the sixth cycle. <br />⭐ **Part Two:** simulate the six-cycle boot process in 4-dimensional space; count how many cubes are left in the active state after the sixth cycle.
26+
| [📁 18](day_18) | **Operation Order** | 📃 **Input:** math homework of child sitting next to you - i.e. series of expressions that consist of addition (`+`), multiplication (`*`), and parentheses (`(...)`).<br />⭐ **Part One:** evaluate the expression on each line of the homework with changed rules of operator precedence - i.e. the `+` and `*` operators have the _same_ precedence; get the sum of the resulting values of each line.<br />⭐ **Part Two:** same as Part One, but with new rules of operator precedence - i.e. `+` has _more_ precedence than `*`.
27+
| [📁 19](day_19) | **Monster Messages** | 📃 **Input:** two blocks of data: (1) rules for valid messages; (2) list of received messages the Elves have collected from their satellite.<br />⭐ **Part One:** find how many messages completely match rule 0. <br />⭐ **Part Two:** same as Part One, but with updated rules (now, the rules _do_ contain loops).
28+
| [📁 20](day_20) | **Jurassic Jigsaw** | 📃 **Input:** array of image tiles along with a random unique ID number.<br />⭐ **Part One:** assemble the tiles into an image; multiply together the IDs of the four corner tiles. <br />⭐ **Part Two:** count how many `#` in assembled image are not part of a sea monster.
29+
| [📁 21](day_21) | **Allergen Assessment** | 📃 **Input:** list of foods - i.e. food's ingredients list followed by some or all of the allergens the food contains (e.g. `sqjhc fvjkl (contains soy)`).<br />⭐ **Part One:** determine which ingredients cannot possibly contain any of the allergens in your list; count how many times do any of those ingredients appear. <br />⭐ **Part Two:** find your canonical dangerous ingredient list - i.e. comma-separated list of ingredients sorted alphabetically by their allergen.
30+
| [📁 22](day_22) | **Crab Combat** | 📃 **Input:** card decks of two players - i.e. two lists of integers.<br />⭐ **Part One:** play the card game (Combat); get the winning player's score - i.e. card values multiplied by their order in the winning deck. <br />⭐ **Part Two:** play the Recursive Combat game; get the winning player's score.
31+
| [📁 23](day_23) | **Crab Cups** | 📃 **Input:** cups' labels (integers).<br />⭐ **Part One:** simulate `100` moves of _crab's cup game_ with given cups (total of `9`) and get labels on the cups after cup `1`. <br />⭐ **Part Two:** simulate ten million (`10000000`) moves of _crab's cup game_ with one million (`1000000`) cups and get product of the two cup labels immediately clockwise (after) cup `1`.
32+
| [📁 24](day_24) | **Lobby Layout** | 📃 **Input:** list of the tiles that need to be flipped over, in the form of hex grid directions (`e`, `se`, `sw`, `w`, `nw`, and `ne`).<br />⭐ **Part One:** count how many tiles are left with the black side up after parsing the input - i.e. after going through the renovation crew's list and determining which tiles they need to flip. <br />⭐ **Part Two:** count how many tiles will be black after 100 days of living art exhibit of lobby's tile floor.
33+
| [📁 25](day_25) | **Combo Breaker** | 📃 **Input:** pair of public keys.<br />⭐ **Part One:** find encryption key of handshake.
34+
35+
![Completed calendar](calendar.png)
36+
37+
## What is *Advent of Code*?
38+
39+
[*Advent of Code*](http://adventofcode.com) is an online event created by [Eric Wastl](http://was.tl/). It consists of *"an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. People use them as a speed contest, interview prep, company training, university coursework, practice problems, or to challenge each other."* - source: https://adventofcode.com/about
840

941
> **TLDR:** an online event where two programming puzzles are released each day from Dec 1st to 25th.
1042
1143
## Puzzles' Story
1244

13-
After saving Christmas [five years in a row](https://adventofcode.com/events), you've decided to take a vacation at a nice resort on a tropical island. Surely, Christmas will go on without you.
14-
15-
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.
16-
17-
To save your vacation, you need to get all **fifty stars** by December 25th.
18-
19-
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!
45+
> After saving Christmas [five years in a row](https://adventofcode.com/events), you've decided to take a vacation at a nice resort on a tropical island. Surely, Christmas will go on without you.
46+
>
47+
> 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.
48+
>
49+
>To save your vacation, you need to get all **fifty stars** by December 25th.
50+
>
51+
>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!

calendar.png

129 KB
Loading

0 commit comments

Comments
 (0)