Introduction
Advent of Code has always been an exciting challenge for me. It’s a chance to test my problem-solving skills, dive into new algorithms, and push the limits of my programming knowledge. This year, 2024, was no different. From dynamic programming puzzles to tricky edge cases, each day brought a new opportunity to grow as a developer.
You can find all my solutions for Advent of Code 2024 here. Below, I’ll share some highlights of my journey.
Highlights of 2024 Challenges
Day 1: A Gentle Start
The first day eased us in with a problem that involved parsing input and applying basic logic. It was a great way to kick off the event and get familiar with the format.
Day 5: Dynamic Programming Awakens
One of the most memorable days for me. The challenge required a clever application of dynamic programming to find an optimal solution. Debugging this solution taught me the importance of stepping through examples to validate assumptions.
Day 12: Graph Traversals
Day 12 took us into the world of graphs! Implementing Dijkstra’s algorithm reminded me of how versatile graph-based solutions can be for real-world problems. Alongside, BFS and DFS came in handy for exploring various states efficiently.
Day 18: Debugging Frenzy
This day was particularly tough. The logic seemed sound, but small edge cases kept breaking my solution. After hours of debugging, I finally found the culprit—a subtle off-by-one error. A classic but humbling moment!
Day 21: Theoretical Informatics
One of the standout puzzles involved computing a maximum clique in a graph—a classic NP-complete problem. While finding exact solutions wasn’t feasible, it was a great opportunity to explore heuristics and approximations.
Tools and Techniques
Here are some tools and techniques that helped me:
- Language of Choice: Java, that’s my primary language but next year I should go for Haskell?? Not sure :D.
- Recursion and Memoization: Essential for problems requiring overlapping sub-problems, such as dynamic programming challenges.
- Graph Algorithms: Dijkstra’s, BFS, and DFS became daily companions.
- Visualization: Pen and Paper :D My friends to tackle some of the hardest problems (i.e., definitely Day 21)
Lessons Learned
- Break Down the Problem: Complex puzzles become manageable when broken into smaller parts.
- Always test early and think about the problem….: Spotting bugs early can save hours of frustration.
- Stay Persistent: Some puzzles seem impossible at first glance, but perseverance pays off. This one is very very and very TRUE! :D
- Algorithm Optimization: Using the right algorithm can drastically reduce computation time. Dijkstra’s for shortest paths, BFS/DFS for state exploration, and recursion with memoization for overlapping sub-problems were crucial tools in my arsenal.
- Theoretical Informatics: Tackling NP-complete problems like the clique computation gave me a deeper appreciation for complexity theory and approximation techniques.
Final Thoughts
Advent of Code 2024 has been a thrilling and rewarding experience. I t pushed me to think critically, code efficiently, and embrace challenges. From recursion and memoization to NP-complete problem-solving, it’s been a journey of immense learning.
Feel free to explore my solutions and share your own journey. Until next year, happy coding!