:3
Everything is barely weeks. Everything is days. We have minutes to live.
- about me
- Github: @r1bb1t-h0l3
Everything is barely weeks. Everything is days. We have minutes to live.
Still on my Learn to Code by Solving Problems binge, and I found this problem quite interesting, so I decided to share my solution and thought process behind it.
The USACO Tic-Tac-Toe problem is a variation of the classic game, with cows claiming squares and competing for victories individually or as pairs. The full text can be found here
The reason I decided to write this up is because initially I had solved it in a way that should have worked (to my mind), but didn’t (around 50% of the test cases failed). I couldn’t quite figure out why and had a look at the solution provided. Turned out that the magic ingredient I was missing was sorted tuples.
Posted · Author ribbit
When I decided it was time to develop a more formal understanding of algorithms, I turned to Grokking Algorithms by Aditya Y. Bhargava, published by Manning Publications in 2016. This book consistently came up in online recommendations as an approachable, beginner-friendly introduction to algorithms, and that’s exactly what I was looking for—a bird’s-eye view of the subject without diving too deeply into technical details.
I wanted a foundational understanding of algorithms that I could build on, and this book sure delivered. With just 11 chapters, it’s concise yet comprehensive, making it an excellent starting point for anyone who is, like me, new to algorithms.
Posted · Author ribbit
Disclaimer: I have no idea why this problem is called “Misa” when the protagonist’s nme is “Mirko”. I can only assume that “misa” is maybe Czech for “mass”, as the problem is about shaking hands with people at church:)
Anyway, I really enjoyed this problem, and I want to explore the approach and logic behind solving a seating arrangement problem involving handshakes. The algorithm I came up with is designed to calculate two key values:
1. The number of existing handshakes in the seating arrangement.
2. The maximum additional handshakes possible if Mirko takes a seat optimally.
This solution employs a grid traversal algorithm with careful attention to boundary conditions, allowing it to work well for seating matrices of varying sizes.
Posted · Author ribbit
The book I’m reviewing today is JavaScript Crash Course , authored by Nick Morgan and published by No Starch Press in 2024. It’s a relatively recent release and sits at 376 pages—making it a mid-length read. I picked up this book while starting my journey into learning JavaScript for web development. It came highly recommended by people on Reddit (where else would one look for such recommendations?), and since I’ve had great experiences with other No Starch Press titles, I decided to give it a try. Spoiler alert: I wasn’t disappointed! But also, this is a review written by a very green beginner to webdev, so if you are in any way experienced, you will likely not find the parts I describe as “challenging” actually “challenging”.
Posted · Author ribbit
This one was definitely tough! By this one I mean this Decoding DNA problem from dmoj.ca. I have to admit that simply understanding the task was probably at least half the challenge, as I am not very familiar with how DNA works.
Posted · Author ribbit
Reversing a list is a common operation, especially in algorithmic problem-solving and data manipulation. Even though Python provides simple, built-in ways to reverse a list, since I am specifically trying to improve my algorithmic thinking and logical reasoning skills, I am focussing on purely algorithmic reversal. Specifically I am doing this as prep to solving a DMOJ problem I am working on which I will share a bit later.
So here are the three different ways I found to reverse a list in Python without using any built-in methods like .reverse()
or slicing ([::-1])
. They all make sense to me, so hopefully as I get a little more practise implementing them the logic will start to feel second nature. My favourite is the last one with modulo and floor division, as the second one still feels a bit like “python magic” with tuple unpacking being used and the first one is range(len)
magic.
Posted · Author ribbit
In Python a set is considered to be an unordered collection of unique elements. I found out about this method when solving the From 1967 to 2013 Problem on DMOJ. I actually wrote a different solution initially, one that iterated through 4 digits, comparing them to each other, but then I noticed that the input can go up to the tens of thousands. Also my submission only passed half the test cases😩.
Posted · Author ribbit
To further my understanding of the Bootstrap framework, I decided to create a one-page portfolio. The idea behind the design was to have each section fill the screen as you navigate through it. So, when you switch between sections, the viewfinder shifts smoothly, giving a full-screen focus to each part. However, when you scroll down normally, there’s quite a bit of blank space, which I’m not totally sure I like. But, on the flip side, I really like the clean, minimalist look it gives, so I’m leaving it for now. Maybe I’ll come up with a way to refine it down the line.
Posted · Author ribbit
Over the past month, I’ve been focusing on improving my fundamental programming skills, not by learning more Python tricks, but by strengthening my core understanding of programming concepts. A lot of this has involved working on DMOJ problems and reading Learn to Code by Solving Problems by Daniel Zingaro.
Recently, while solving a problem from the Timus judge, the book introduced the top-down approach. This approach has been incredibly helpful for me, especially when it comes to structuring code and using functions effectively. The top-down method encourages you to start by breaking down a task into broad steps and then narrowing down what each function needs to accomplish.
Posted · Author ribbit
As part of my journey into front-end development, I decided to learn Bootstrap after spending some time with CSS and Flexbox. Bootstrap is often recommended as an easy-to-learn framework for beginners, and that’s what drew me to it. After using it for a few weeks, I found the framework — and especially the documentation — simple, clear, and incredibly helpful. Although I’m still scratching the surface, my overall experience has been positive, and I can see the vast potential Bootstrap offers for building responsive websites.
Posted · Author ribbit