Advent of Code Day 2 in Golang: Slicing and Dicing Reports

Introduction

So, this is day 2 of the Advent of Code 2024 in Golang, and we will be exploring my approach and solution for the same. The problem was not as easy but was pretty simple after implemented and found correct.

You can check out my solutions here on GitHub.

Part 1

We have been given some lines called reports, and each report has a bunch of levels. and the requirement of the report is that it needs to be either strictly increasing or decreasing by a factor of at least 1 or at most 3.

[]

Advent of Code, 2024, Day 1 in Golang: Historian Hysteria

Introduction

Hello everyone, it’s that time of the year, Advent of Code, I will be solving this year as well with Golang. In previous years I have been doing Advent of Code but was not able to keep up with the pace and left it midway (not even halfway). This year however I am determined and want to solve all the problems as much as I can.

Let’s dive into the first day which should be and is pretty simple and straightforward. A simple list and map creation and traversal and basic math operations.

[]

Sample TIL

What I learned

This is the content of the TIL

Conclusion

Happy Coding :)

[]

Techstructive Weekly #18

Week #18

It was a great week, if I could call it a hard-working week, it would be appropriate. I started the week (the weekends) by streaming, creating a video, and planning a few more videos for the next week. Then starting the week with deep intense programming sessions, a couple of flow states during the week made the mind feel accomplished and excited.

After releasing the code that I had been working on for so long in the past week, this week was about taking a new approach to the initial implementation, and it was smooth, it felt good, I was able to change the code that I had written faster and iterate on it quickly. This gave me the confidence that I can write production-ready and readable code. I am not that bad, there is a lot to improve on but quite a good feeling to live with and continue the work.

[]

Gotcha with Chained Assignment in Python

A lesson learned about Python’s chained assignment with mutable objects, where all variables store references to the same object, leading to unexpected behaviour when one is modified.

[]

Techstructive Weekly #17

Week #17

What a week, had written code through all the days, thought a lot about solving certain issues, integrated reviewed changes, and also wrote and created a video on the weekend.

This was the week of releasing the thing that I have been building over the span of the past 2 months and really felt good this Thursday to release it. Tested it and worked perfectly, now on to a new set of experiments and building on top of the thing in the upcoming weeks or months even, exciting times ahead.

[]

Techstructive Weekly #16

Week #16

This week was really productive, was able to make the code I have been writing for the past 2 months and experiments that have been doing into a deployable and ready to launch code. I finally feel a bit satisfied by my efforts, feel the motivation back, the curiosity back. I had an intense focus or flow state this week, I did not create any content this week as I was out on Sunday and was really tired on Saturday.

[]

Techstructive Weekly #15

Week #15

A wonderful week, bringing back the joy of programming, after some slumpy weeks, a refreshing and mind challenging week. The start was drowzy after a long weekend, but as the week progressed, I had to shift gears and complete the things that took some deep concentration and thinking, finally the results were worth the efforts. Everything in its place, the reward for the focus and hard work.

After a live stream and video creation in the end of week last week, I didn’t do much on Sunday, just took a break and spent the diwali removing the negativity in life. I am not mentioning it enough but I continue the writing routine, 35 days and counting, the writing streak is un-broken, I completed one section of writing of 21 days and now moving on to another section of 17 days, combining a total of (9+21+5(till date)) 35 articles. This is the motivation for me waking up everyday, writing will get me to the places I can dream of.

[]

Techstructive Weekly #14

Week #14

This was an excellent week, I created one video, posted one article, did a live stream setup went live for an hour on Twitch and Youtube, and did some exercise as well—writing of course with the 4th consecutive week.

The week was super-productive to start with, like I had a dream Sunday, I went on a walk in the morning, 6:30 AM, right? I have been procrastinating for months, but finally started doing since this Sunday. And I cannot say how much benefit I had from these walks like there is some energy flowing in me after I come from the walk. There is the fire ignited back, the curiosity flying back, the spark is back and with the habits like this newsletter and others in place, It looks like a dream routine, and it gets better and better. Not gonna Jinx it for the next week.

[]