Coder Social home page Coder Social logo

adventofcode's Introduction

๐ŸŽ„ Advent of Code 2021 ๐ŸŽ„

Summary

This year I will post my solutions to the Advent of code, even though I think they are nothing special. I'm also writing my bachelor thesis right now, so I'm not sure if I'll do all the puzzles - but we'll see ๐Ÿ˜Ž.

Overview

Day Name Status Notes
01 Sonar Sweep โญโญ I think the pandas solution looks nice (a one liner each ๐Ÿ˜Ž) - also there is a nice trick in it that shows that the puzzle is solvable without an sliding window ๐Ÿ˜‰.
02 Dive! โญโญ The solution was really straight forward and only little code was needed.
03 Binary Diagnostic โญโญ I did some beautiful (in my opinion not really) python magic
04 Giant Squid โญโญ Here the python magic was nice ๐Ÿ˜Š - also I used a class for the board.
05 Hydrothermal Venture โญโญ This was just fun ๐Ÿ˜Š - I wanted to avoided creating a line or a point class - so I made heavy use of tuples and list comprehensions
06 Lanternfish โญโญ A little growth simulation was fun and I learned something about the defaultdict.
07 The Treachery of Whales โญโญ Ahh this was cool - the computational complexity was greatly reduced (from nยณ to nยฒ) after finding an explicit formula for the sum of the first n numbers! I learned that these numbers are called triangular numbers. - nice refresher in finite series - a dynamic programming approach would have also reduced the time complexity but would have increased the storage complexity... and I wanted to use the explicit formula since I found one ๐Ÿ˜ - I added a smarter way where the complexity is even much lower (avg: 807ฮผs vs 280ms)
08 Seven Segment Search โญโญ Was easier than I thought in the beginning. - would have been far more complex if not always all numbers would be there, then I had written an algorithm that uses permutations and tries to find an solution to the problem - but the puzzle was fun, even with an hard codable algorithm
09 Smoke Basin โญโญ I found a really nice way of doing this puzzle by heavily leveraging scipy in particular the generic_filter and the label functions ๐Ÿคฉ๐Ÿ˜
10 Syntax Scoring โญโญ reduce the reduce function was the mvp in this challenge. At least for me ^^ (the for else was also not bad) - This time it felt like I'm a step closer to a pythonic coding style ๐Ÿ™‚ (a style that leverages Python's features to write code that is readable and beautiful)
11 Dumbo Octopus โญโญ generic_filter ftw ๐Ÿคฃ - I also did a small visualization on the branch visualizations - the visualization can be also found as a video on youtube
12 Passage Pathing โญโญ I failed again for memory views vs copies .... ๐Ÿ™ˆ yeah that happens ๐Ÿคฃ
13 Transparent Origami โญโญ A friend of mine had an bug in his input.. not really a bug more like an edge case that my input lacked... And yes my code does not work for an fold where the first half is smaller than the second - but as far as I can tell this was never needed... but for completeness it would be desirable ^^
14 Extended Polymerization โญโญ For solution 1 I created a linked list that is iterable but that was of course not nearly enough for solution 2. Solution 2 is just hacked together ... maybe later on the day I will revisit this puzzle. ^^
15 Chiton โญโญ With the networkx library it was doable in just a few lines of code - but the docu of networkx could be "more verbose" ๐Ÿ˜„
16 Packet Decoder โญโญ That was fun but it was also the challenge that took the most time ^^ so many small silly bugs ๐Ÿ™ˆ
17 Trick Shot โญโญ I'm not really proud of the solution because I brute forced instead of using the superposition principle .... but hey I found the solution and it only took me a few minutes ๐Ÿคฃ (code executes in a second or two)
20 Trench Map โญโญ The generic filter does it all ^^
21 Dirac Dice โญโญ With a cache this was quite fast - I just have to remember that dimensions should not interfere with each other ๐Ÿ™ˆ (I summed the scores in the for loop - that was a stupid mistake that took me too long to see) - but the puzzle was fun ๐Ÿ˜Š

adventofcode's People

Contributors

horotw avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.