de-grote / AOC2021

my solutions to the Advent Of Code in 2021!

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AOC2021

my solutions to the Advent Of Code in 2021!

I'll try to upload an answer every day, but I'm not going to sweat the coding time and I'll try to keep the performance acceptable.

Everything is made in python version 3.10.0.

Opinion on Solutions

day 1: I really like the code I made, and the challanges were nice and easy.

day 2: Your avarage 'just loop through the input and see', nothing special here.

day 3: pain. I think my challange 1 solution is pretty optimised, if you can call rotating an array optimised that is. challange 2 took me hours to complete though, but I did succeed even without having to look at any solutions!

day 4: Way bigger file size than i wanted it to be, and it has 4 nested loops so if you're looking for a fast day 4 solution look somewhere else.

day 5: I feel like there is a way to find all the points without simulating the whole board, but if there is one i haven't found it, I also dislike the hardcoded size of 1000x1000 for the grid, but I don't have the time or energy to make better code today.

day 6: This challange was kind of easy but very fun to do! in part 1 I tried to get a solution in as little lines as possible, in which I think I suceeded, but in part 2 I can't just use the same code as it took lonfer than a minute and I did not feel like waiting, so I just used a whole lot of varible assignment, which is a million times faster but it's a lot of repeating code.

day 7: My solution here is pretty optimised, eventhough it takes a second or two to run, I can't think of a faster way to do it, if you're wandering what I did in part two, look up triangle numbers.

day 8: part 1 was an easy one-liner but part 2 took me hours to complete, I still despise the linecount even after I shorted it by 50%.

day 9: I really liked the challange of today! and my solutions too. Part 1 is just some looping, but part 2 has a whole to-do list of places it needs to check, eventhough it's pretty slow I love the way it works!

day 10: Pretty easy day, still a good and fun challange though.

day 11: This one took a lot of time and effort, looking back on it, I should've probably just used a 2d array but i really wasn't feeling like it, so thats what all that for loop hardcoding is.

day 12: while very difficult, I think i did a great job at doing recursive backtracking, which I've honestly never done before, but it was a lot of fun to make, and fix.

day 13: I still don't know how solution 1 works and at this point I'm too afraid to find out, also part 2 took me longer than I want to admit so I'll just not say how long it took...

day 14: Solution 1 is better than solution 2 eventhough it's slower, fight me.

day 15: Why do I need to make someone elses homework? btw part 2 takes like 3 hours and I'm not going to make it better.

day 16: A lot of hardcoding but very doable, it was harder to know what to make than to make it.

day 17: After two days of way to complicated challanges we finally got a good one! Part 1 in one line and part 2 with optimised search.

About

my solutions to the Advent Of Code in 2021!


Languages

Language:Python 100.0%