Skip to content

swd1tn002/advent-of-code-2021

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

135 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of code 2021 Python package

This repository contains my personal solutions to Advent of code 2021.

All solutions are written in Python.

Things exercised during the days

  • Days 1 and 2

    • Pytest
    • GitHub actions
    • map function
  • Day 3

    • type hinting
    • from typing import List
    • zip function
    • bitwise xor ^
    • parsing binary numbers to decimals
    • pytest @fixture
  • Day 4

    • zip function
    • transposing a matrix with zip function
    • flatmap with Python generators
  • Day 5

    • named tuples
  • Day 6

    • using pop to simulate a queue with a list
  • Day 7

    • speeding up recurring calls to function by memoizing the results with @cache decorator
  • Day 8

    • all sorts of set operations
    • iter and next
  • Day 9

    • enumerate
  • Days 10 and 11

    • regular expressions
    • using a dict with coordinates to represent two dimensional maps
  • Day 12

    • Classes and objects
    • __str__ and __repr__
  • Day 13

    • Thinking in terms of sets of coordinates and not two dimensional structures
  • Day 14

    • First puzzle that I could not solve alone. Found a hint for part 2 from Koodiklinikka.
    • Using Counter to streamline counting character values
  • Day 15

    • Using Dijkstra's Algorithm to find minimum travel cost between two points
  • Day 16

    • Object oriented programming
    • Superclasses and subclasses
    • Overriding __len__ and __eq__
    • Creating generator functions with yield keyword
  • Day 17

    • Object oriented programming
  • Day 18

    • This was quite tricky
    • Using reduce to add all snail numbers together
  • Day 19

    • This was again very difficult to solve...
    • Yielding lambdas
  • Day 20

    • Working with infinite size images
  • Day 21

    • Second puzzle where I could not solve part 2 alone. Found a hint 2 from Koodiklinikka.
  • Day 22

    • Got a slow but working solution together after all.
    • Splitting a collection overlapping 3D cubes into non-overlapping ones until no cubes overlap.
  • Day 23

    • Applying the shortest path logic to find the most efficient moves to solve a puzzle.
  • Day 24

    • Iterative and recursive calls to a list of functions to keep and cache intermediate results.
    • Interpreting another languate into Python.
  • Day 25

    • Wrapping a 2D plane over the horizontal and vertical axes.

About

This repository contains my personal solutions to Advent of code 2021. All solutions are written in Python.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages