Home

Awesome

Advent of Code 2020

All my Advent of Code repos:

 

Solutions

TaskNimPythonRacketComments (for Nim solutions)
Day 1: Report Repairday01.nimday01.pyday01.rktSmall check elif s[i] + s[j] < 2020: makes the whole program ~4x faster.
Day 2: Password Philosophyday02.nimday02.pyday02.rktscanf useful as always.
Day 3: Toboggan Trajectoryday03.nimday03.pyday03.rktKeeping it below 20 lines :)
Day 4: Passport Processingday04.nimday04.pyday04.rktHad a nasty early morning bug with if not v.len == 9. Argh.
Day 5: Binary Boardingday05.nimday05.pyday05.rktTraversing a sorted list is more efficient than looking for every number in unsorted one.
Day 6: Custom Customsday06.nimday06.pyday06.rktClassic AoC-use-sets tasks.
Day 7: Handy Haversacksday07.nimday07.pyday07.rktBabushka bag = Bagushka.
Day 8: Handheld Haltingday08.nimday08.pyday08.rktFaster than it looks.
Day 9: Encoding Errorday09.nimday09.pyday09.rktSliding slice sum.
Day 10: Adapter Arrayday10.nimday10.pyday10.rktCountTable to the rescue.
Day 11: Seating Systemday11.nimThe ugliest and the slowest solution so far.
Day 12: Rain Riskday12.nimday12.pyday12.rktUsing complex numbers is soooo last Tuesday. No Complex this time.
Day 13: Shuttle Searchday13.nimday13.pyday13.rktYeah yeah, CRT, but it took me way too long to implement it correctly.
Day 14: Docking Dataday14.nimGood luck trying to understand what's going on.
Day 15: Rambunctious Recitationday15.nimBoring.
Day 16: Ticket Translationday16.nimNaming is hard.
Day 17: Conway Cubesday17.nimNobody notices your 9 nested for-loops if you hide them in a template.
Day 18: Operation Orderday18.nimTemplate and streams make this one really elegant.
Day 19: Monster Messagesday19.nimMy first experience with npeg.
Day 20: Jurassic Jigsaw
Day 21: Allergen Assessmentday21.nimDay 16, part 2 vibes.
Day 22: Crab Combatday22.nimDeque Deck for Crab Combat.
Day 23: Crab Cupsday23.nimNo Linked List for Crab Cups: 10x faster and lighter (less memory usage).
Day 24: Lobby Layoutday24.nimRead redblobgames if you haven't already.
Day 25: Combo Breakerday25.nim

Run times

The reported results are the average of 20 runs.

01     0.72 ms
02     0.82 ms
03     0.63 ms
04     1.23 ms
05     0.80 ms
06     0.96 ms
07     1.89 ms
08     1.06 ms
09     1.01 ms
10     0.72 ms
11    26.66 ms
12     0.93 ms
13     0.63 ms
14    11.57 ms
15   583.13 ms
16     4.62 ms
17    64.36 ms
18     1.48 ms
19    17.52 ms
20    12.16 ms
21     1.86 ms
22     1.06 ms
23   208.55 ms
24    16.32 ms
25     5.42 ms
--------------
        966 ms