Skip to content

tymscar/Advent-Of-Code

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Advent of Code🌲

Advent of Code is 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. There's a puzzle each day with two parts. For each part you resolve, you get one one star, so by the end of the 25 days, if you do all the 25 puzzles with both parts you get 50 stars.

My story in 2024 πŸ¦„

This year marked an exciting milestone as I started my new role as a Senior Software Engineer at Glean. To align with my work and further enhance my skills, I decided to tackle the Advent of Code challenges using Kotlin. This choice not only allowed me to apply what I use daily at work but also made solving the puzzles more seamless and enjoyable.

I'm proud to share that I achieved 50 stars once again, maintaining my streak of consistent participation. The puzzles were both engaging and thought-provoking, providing just the right level of challenge to keep me motivated throughout the 25 days.

While I thoroughly enjoyed the variety, I was a bit disappointed that there were no cellular automata puzzles this year. However, the abundance of Dijkstra-related challenges more than made up for it, giving me ample opportunities to dive deep into graph algorithms and pathfinding problems.

Overall, this year's Advent of Code was a perfect blend of professional growth and personal accomplishment, and I'm looking forward to what next year has in store!

╔════════════════════════════════════════════════════════════════════════════════════════════════════════════════╗
β•‘                                           πŸ¦„ Advent of Code 2024 πŸ¦„                                            β•‘
╠════════════════════════════════╦═══════════════════════╦════════════════════════════════════════════╦══════════╣
β•‘ Day                            β•‘ Part 1                β•‘ Part 2                                     β•‘ Time     β•‘
╠════════════════════════════════╬═══════════════════════╬════════════════════════════════════════════╬══════════╣
β•‘ Day 01: Historian Hysteria     β•‘ 1189304            βœ… β•‘ 24349736                                βœ… β•‘ 29    ms β•‘
β•‘ Day 02: Red-Nosed Reports      β•‘ 639                βœ… β•‘ 674                                     βœ… β•‘ 15    ms β•‘
β•‘ Day 03: Mull It Over           β•‘ 159833790          βœ… β•‘ 89349241                                βœ… β•‘ 10    ms β•‘
β•‘ Day 04: Ceres Search           β•‘ 2562               βœ… β•‘ 1902                                    βœ… β•‘ 124   ms β•‘
β•‘ Day 05: Print Queue            β•‘ 4814               βœ… β•‘ 5448                                    βœ… β•‘ 138   ms β•‘
β•‘ Day 06: Guard Gallivant        β•‘ 4758               βœ… β•‘ 1670                                    βœ… β•‘ 3      s β•‘
β•‘ Day 07: Bridge Repair          β•‘ 1289579105366      βœ… β•‘ 92148721834692                          βœ… β•‘ 18    ms β•‘
β•‘ Day 08: Resonant Collinearity  β•‘ 240                βœ… β•‘ 955                                     βœ… β•‘ 5     ms β•‘
β•‘ Day 09: Disk Fragmenter        β•‘ 6310675819476      βœ… β•‘ 6335972980679                           βœ… β•‘ 1      s β•‘
β•‘ Day 10: Hoof It                β•‘ 638                βœ… β•‘ 1289                                    βœ… β•‘ 260   ms β•‘
β•‘ Day 11: Plutonian Pebbles      β•‘ 212655             βœ… β•‘ 253582809724830                         βœ… β•‘ 60    ms β•‘
β•‘ Day 12: Garden Groups          β•‘ 1370258            βœ… β•‘ 805814                                  βœ… β•‘ 304   ms β•‘
β•‘ Day 13: Claw Contraption       β•‘ 28887              βœ… β•‘ 96979582619758                          βœ… β•‘ 5     ms β•‘
β•‘ Day 14: Restroom Redoubt       β•‘ 218965032          βœ… β•‘ 7037                                    βœ… β•‘ 263   ms β•‘
β•‘ Day 15: Warehouse Woes         β•‘ 1406628            βœ… β•‘ 1432781                                 βœ… β•‘ 491   ms β•‘
β•‘ Day 16: Reindeer Maze          β•‘ 102460             βœ… β•‘ 527                                     βœ… β•‘ 14     s β•‘
β•‘ Day 17: Chronospatial Computer β•‘ 6,0,6,3,0,2,3,1,6  βœ… β•‘ 236539226447469                         βœ… β•‘ 6     ms β•‘
β•‘ Day 18: RAM Run                β•‘ 324                βœ… β•‘ 46,23                                   βœ… β•‘ 939   ms β•‘
β•‘ Day 19: Linen Layout           β•‘ 213                βœ… β•‘ 1016700771200474                        βœ… β•‘ 360   ms β•‘
β•‘ Day 20: Race Condition         β•‘ 1317               βœ… β•‘ 982474                                  βœ… β•‘ 1      s β•‘
β•‘ Day 21: Keypad Conundrum       β•‘ 270084             βœ… β•‘ 329431019997766                         βœ… β•‘ 1      s β•‘
β•‘ Day 22: Monkey Market          β•‘ 12759339434        βœ… β•‘ 1405                                    βœ… β•‘ 27     s β•‘
β•‘ Day 23: LAN Party              β•‘ 1108               βœ… β•‘ ab,cp,ep,fj,fl,ij,in,ng,pl,qr,rx,va,vf  βœ… β•‘ 221   ms β•‘
β•‘ Day 24: Crossed Wires          β•‘ 57344080719736     βœ… β•‘ cgq,fnr,kqk,nbc,svm,z15,z23,z39         βœ… β•‘ 8     ms β•‘
β•‘ Day 25: Code Chronicle         β•‘ 3133               βœ… β•‘                                         βœ… β•‘ 15    ms β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•

What I ended up with

  • I embraced Kotlin, leveraging it from my new role at Glean to solve complex problems efficiently.
  • I maintained my streak by achieving 50 stars once again.
  • I had a lot of fun and learned a bunch!

My story in 2023 πŸ¦€

Another year, another Advent of Code! I was quite hyped for this one because 2023 wasn't my best year in general.

The challenge for this year was to use Rust. I have read Rust code before, and I have played with some small CLI programs, but I have never used it in anger for as long as this.

There were some amazing problems this year that I enjoyed very much, such as day 19 and day 25, and some that I didn't enjoy like 24, and 21 because either I needed to use third party crates, like Z3 for 24, or there were hidden assumptions in the input such as day 21.

I got very confident in my Rust skills, and I can't wait to use it more for other projects! I was afraid at first that I will get stuck with rust's borrow checker when the problems would get harder, but that has never been the case, and it's a much easier task than I have expected. I only really got stuck with lifetimes once, but I managed to solve the issue quite quickly with the help of the compiler.

Here is a nice table for all the problems of this year, I have generated it in rust too! (It looks better in the terminal with a monospace emoji font)

╔════════════════════════════════════════════════════════════════════════════════════════════╗
β•‘                                 πŸ¦€ Advent of Code 2023 πŸ¦€                                 β•‘
╠═════════════════════════════════════════╦══════════════════╦═════════════════════╦═════════╣
β•‘ Day                                     β•‘ Part 1           β•‘ Part 2              β•‘ Time    β•‘
╠═════════════════════════════════════════╬════════════╦═════╬═══════════════╦═════╬═════════╣
β•‘ Day 01: Trebuchet?!                     β•‘ 55538      β•‘ βœ… β•‘ 54875          β•‘ βœ… β•‘  402 ΞΌs β•‘
β•‘ Day 02: Cube Conundrum                  β•‘ 2600       β•‘ βœ… β•‘ 86036          β•‘ βœ… β•‘  141 ms β•‘
β•‘ Day 03: Gear Ratios                     β•‘ 527369     β•‘ βœ… β•‘ 73074886       β•‘ βœ… β•‘   15 ms β•‘
β•‘ Day 04: Scratchcards                    β•‘ 23028      β•‘ βœ… β•‘ 9236992        β•‘ βœ… β•‘  433 ΞΌs β•‘
β•‘ Day 05: If You Give A Seed A Fertilizer β•‘ 157211394  β•‘ βœ… β•‘ 50855035       β•‘ βœ… β•‘   76 ΞΌs β•‘
β•‘ Day 06: Wait For It                     β•‘ 393120     β•‘ βœ… β•‘ 36872656       β•‘ βœ… β•‘   66 ms β•‘
β•‘ Day 07: Camel Cards                     β•‘ 248422077  β•‘ βœ… β•‘ 249817836      β•‘ βœ… β•‘    6 ms β•‘
β•‘ Day 08: Haunted Wasteland               β•‘ 13301      β•‘ βœ… β•‘ 7309459565207  β•‘ βœ… β•‘   14 ms β•‘
β•‘ Day 09: Mirage Maintenance              β•‘ 1696140818 β•‘ βœ… β•‘ 1152           β•‘ βœ… β•‘  459 ΞΌs β•‘
β•‘ Day 10: Pipe Maze                       β•‘ 6923       β•‘ βœ… β•‘ 529            β•‘ βœ… β•‘    4 ms β•‘
β•‘ Day 11: Cosmic Expansion                β•‘ 9545480    β•‘ βœ… β•‘ 406725732046   β•‘ βœ… β•‘   82 ms β•‘
β•‘ Day 12: Hot Springs                     β•‘ 7771       β•‘ βœ… β•‘ 10861030975833 β•‘ βœ… β•‘   28 ms β•‘
β•‘ Day 13: Point of Incidence              β•‘ 32723      β•‘ βœ… β•‘ 34536          β•‘ βœ… β•‘    6 ms β•‘
β•‘ Day 14: Parabolic Reflector Dish        β•‘ 112048     β•‘ βœ… β•‘ 105606         β•‘ βœ… β•‘   17 ms β•‘
β•‘ Day 15: Lens Library                    β•‘ 511257     β•‘ βœ… β•‘ 239484         β•‘ βœ… β•‘  344 ΞΌs β•‘
β•‘ Day 16: The Floor Will Be Lava          β•‘ 7472       β•‘ βœ… β•‘ 7716           β•‘ βœ… β•‘  238 ms β•‘
β•‘ Day 17: Clumsy Crucible                 β•‘ 817        β•‘ βœ… β•‘ 925            β•‘ βœ… β•‘  262 ms β•‘
β•‘ Day 18: Lavaduct Lagoon                 β•‘ 50603      β•‘ βœ… β•‘ 96556251590677 β•‘ βœ… β•‘   83 ΞΌs β•‘
β•‘ Day 19: Aplenty                         β•‘ 476889     β•‘ βœ… β•‘ 132380153677887β•‘ βœ… β•‘  600 ΞΌs β•‘
β•‘ Day 20: Pulse Propagation               β•‘ 812721756  β•‘ βœ… β•‘ 233338595643977β•‘ βœ… β•‘   56 ms β•‘
β•‘ Day 21: Step Counter                    β•‘ 3773       β•‘ βœ… β•‘ 625628021226274β•‘ βœ… β•‘  441 ms β•‘
β•‘ Day 22: Sand Slabs                      β•‘ 403        β•‘ βœ… β•‘ 70189          β•‘ βœ… β•‘   12 ms β•‘
β•‘ Day 23: A Long Walk                     β•‘ 2250       β•‘ βœ… β•‘ 6470           β•‘ βœ… β•‘    4 s  β•‘
β•‘ Day 24: Never Tell Me The Odds          β•‘ 11246      β•‘ βœ… β•‘ 716599937560103β•‘ βœ… β•‘    2 s  β•‘
β•‘ Day 25: Snowverload                     β•‘ 507626     β•‘ βœ… β•‘                β•‘ βœ… β•‘  221 ms β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•

In the end, I succeeded πŸŽ‰!!

What I ended up with

  • I finished all 25 days with both parts for each!
  • I learned Rust, and I have managed to write quick and correct programs
  • I had a lot of fun and learned a bunch!

My story in 2022 πŸ’½

By this point Advent of Code and getting 50 stars has become a clear tradition for me.

This year I found the puzzle descriptions way easier to understand, something which I know people and I used to struggle with in the past. The difficult puzzles, 16, 19 and 22 were 3 days apart so I never felt burnt out.

One challenge I set up for myself was to finish as many days as I could fully functionally this year with no side effects and mutation (of course, except input and output).

I did 14/25 days fully functionally. Usually the days I chose to do recursively I did so because of performance reasons. For day23 for example I still have part1 written both functionally and iteratively because I needed the speed for part2. Maybe next year I will pick a language that will help me surpass the speed issues I get with recursion in TS.

In the end, I succeeded πŸŽ‰!!

What I ended up with

  • I finished all 25 days with both parts for each!
  • I used Typescript for all the puzzles, and I enjoyed it. Made writing code in a functional way quite easy, the only issue I had was the lack of tail call optimization.
  • I had a lot of fun and learned a bunch!

My story in 2021 ⌨️

So I got 50/50 stars for the past couple of year, I had to do it now as well!

The pandemic is still not over, but Advent of Code was there for me, something you can count on in this ocean of uncertainty.

Overall I found this year's puzzle harder than the past couple of years, and I think that is mostly because all the hard puzzles were next to eachother with no time to relax in-between. I think that if I would've missed a single puzzle post day 18, I probably wouldn't have been able to catch up and finish on time.

In the end, I succeeded πŸŽ‰!!

What I ended up with

  • I finished all 25 days with both parts for each!
  • I used Javascript for all the puzzles, something I haven't done yet when it comes to programming challenges.
  • I had a lot of fun!

My story in 2020 πŸ‘¨β€πŸ’»

Last year I planned on getting 50 stars, and, I did it. So I had no choice but to do the same this year 😏

This year was not an amazing year in general, but Advent of Code was a great end to it. I enjoyed every single puzzle.

This year I participated quite a bit on the subreddit as well with different visualisations of the problems that I've made in Blender.Day 3, Day 4, Day 20 and Day 24. On the first day I even came up with a part 3 to the problem and people started solving it 😁 There's also lessons I've learned this year. For example on day 13 I found out about the Chinese remainder theorem and day 19 showed me that I need to brush up on my Regex skills. Day 20 part 2 took me the longest by far. I tried for 3 days straight to solve it, and in the end, after 7 rewrites, it has proven to be a wrong assumption I made about how you calculate edge values. So that thought me to always question your assumptions when something goes wrong!

In the end, I succeeded πŸŽ‰!, and it made 2020 a tiny bit better!

What I ended up with

  • I finished all 25 days with both parts for each!
  • I had the opportunity to use Python which I learned last year!
  • I had a lot of fun and learned about a few new things such as the chinese remainder theorem!

My story in 2019 πŸ–₯️

Last year, in 2018, I proposed to myself to get 25. One of my bucket lists items for 2019 was to get 50 stars on Advent of Code.

To make it even more interesting, I've set out to learn Python while doing it as well. This way, I will end up with not only more knowledge of algorithms but with an extra tool in my toolset! It proved out to be quite challenging, some days (18 and 22) taking me up to 12 hours to complete (😴), while others took me less than 15 minutes!

In the end, I succeeded πŸŽ‰! I'm still not sure what the plan is for next year, but I can't wait to give it another go!

What I ended up with

  • I finished all 25 days with both parts for each!
  • I've learned Python to a degree which will help me in the future
  • I had a lot of fun and learned about a few new things such as memoisation!

My story in 2018 πŸ’»

In 2017, when I first heard about Advent of Code I've only done the first 7 days and even out of those, two of them I only finished the first part of, ending up with a total of 12 stars.

Now, in 2018, after finishing university, I started working full time. But I still wanted to keep my promise of getting at least 25 stars. It was very hard to keep to that promise with busy schedule but I succeeded πŸŽ‰. Out of the 25 days, I finished most of them with 2 stars(16/25). The only challenge I haven't had time to do at all was day 24. Three other days I did not get any star for. Days 15 and 17 work on the example input, there are some edge cases which I found when it comes to the actual input, but I just don't have enough time to debug right now. Day 20 I haven't finished either because even though the regex algorithm I wrote for it works, its way too slow on the real input. And we are talking hours here. So there was no reason to finish that challenge before optimising the regex code first. You could still find these "not finished days" here in this repo.

What I ended up with

  • I worked on 24 out of the 25 days. Only missed day 24 😣.
  • Out of those 24 (which you can find here on this github repo) 21 worked.
  • Out of those 21 that worked, 16 gave me two stars.
  • I ended up with a total of 37 stars this year!

What I wanted

The goal of each day for me was not to do it in the fastest manner or to have the cleanest, or most optimised code, but rather to get it working and have the logic behind of it understood. That's why this might not be the cleanest C++ code you've seen to date 😬