Advent of Code 2022 and Exercism

3.29.2023


Lately I have been doing some code challenges and participating at exercism.com after hearing good things about the platform. They have exercises available in many languages and an active community. I focused on typescript and javascript and uploaded some of my solutions to github, or you can find my exercism profile here. I was also able to contribute as a mentor to a couple people looking for explanations or assistance with problems. Exercism has an easy way to copy or export the code and tests to a local machine. This lets you preserve the challenges in case anything happens to the website and a good way to share the solutions.


Latest exercism stats:
Typescript challenges completed: 60
Javascript challenges completed: 40
Including implementing some cool functions such as:


Part of the reason for practicing more code challeneges was to prepare for the interview process and push my understanding of the languages and features. Doing this around the holidays I learned about the Advent of Code, great timing! The advent of code is a holiday coding challenge broken down into 25 2-part challenges. It's known for:

  • being more challenging as it goes on
  • having some large numbers and inputs to deal with
  • testing your problem solving skills with programming


It's very flexible in what kind of environment and tools you use. Any language or method is allowed as long as you find the correct answer. I chose to use only javascript. Some of the days were very difficult and time consuming. On some I had to look at the AOC reddit for hints, but most days I was able to finish alone using just the MDN javascript docs. Even if I did get hints, it is all original code except a few common functions. Overall fairly pleased with my solutions and more importantly gaining more experience with these types of problems. Some of the advanced topics involved maze solving, Breadth First Search, Depth First Search, Linked Lists, Circular Linked Lists, recursive structures, modular arithmetic, 3d arrays and matrices, and lots of object oriented programming in my solutions.


My solutions to Advent of Code 2022 and Exercism on github



Most of my solutions run reasonably fast. I was happy to finish days 20-25 without help and with decently fast runtimes. Overall it was mostly fun solving these puzzles and definitely educational. The code I wrote by the end of the challenge was a lot tighter and felt more comfortable solving them. A few things that I found helpful while working on these was to send the output and logs of a node script to an output file like:
node aoc2022day1.js > output.log &

Sometimes it was easier using paper to write out observations or math or draw something to get started before moving to the programming part. A lot of the effort was planning and thinking about how to approach each problem. It was very difficult at times, but that also means you feel more accomplished when completing a hard one. I was impressed with the creative story, well designed puzzles, and the calendar itself. Getting 50 stars was not easy and it felt great to finish. Another valuable aspect is looking back at other's approaches and solutions after finishing a problem. It's a good introduction to other languages and styles. In addition to looking at javascript I have been reviewing the days and looking at typescript and python solutions as well.


I missed the starting date this year and wasn't competing for speed or to even finish the calendar on time. I think that worked out perfectly so I could really put as much time into each question as needed. Many times that meant spending more than one day on a question. That allowed me to learn a lot of different ideas and move through it at my own pace. It would be fun in another way though to start another years AOC on the 1st day and try to keep up with the daily calendar. There are many past years AOCs that I have never seen and that could be fun to work through.


Some people in the community also made visualizations of different questions, that is something I'd like to do. Those can be very helpful when trying to learn a concept, visualizations helped me when looking at BFS and DFS this year. It would also be valuable to go back and make some optimizations. There is certainly a lot of room for improvement and looking at other people's solutions is a good place to find inspiration for improvements.