11/26 Exploring Beginner Algorithms: Challenges, Insights, and the Joy of Problem-Solving
Exploring Beginner Algorithms: Challenges, Insights, and the Joy of Problem-Solving
Today, I worked on four new beginner-level algorithm problems. The experience was truly fascinating. I’m still quite inexperienced and often struggle to write the solutions myself, but I really enjoy the process of racking my brain. The moment I see the instructor’s explanation and suddenly everything clicks—it’s like a whole new world unfolding before me. I’m completely hooked on this feeling.
The first problem
The first problem was about iterating through numbers and calling out “pass” whenever you encounter a number that is 7, contains the digit 7, or is a multiple of 7.
You can find it here: Code
The second problem
The second problem was finding the square root of a number. The concept of iterating and comparing to approximate a result is so clever. Even though the problem was simplified, it taught me a lot. I can see how this kind of thinking would be incredibly useful when writing business logic.
You can find it here: Code
This reminds me of something David once said: the most time-consuming part of coding is often dealing with the details, not the overall big picture.
The third problem
The third problem was a number-guessing game. I could actually write the solution for this one, but I sometimes get confused about the exit condition for a while loop. Later, I realized that using a flag variable to handle it works really well. The instructor also introduced a “fallback mechanism,” which made me laugh. It’s exactly what I need when my luck runs out—laughing through the pain.
You can find it here: Code
The final problem
The final problem was determining whether a number is a prime number. The code was relatively short, but it really challenged my logical thinking.
You can find it here: Code
I feel so motivated to keep learning and solving more problems. These exercises, though simple, left me with a lot of thoughts today, so I decided to write this study diary to reflect on my progress. Let’s keep moving forward!