⇦ Back

Problem Solving

Sprint 4 | Tech

That time I was blocked on a simple problem...

I have the feeling that I am always stuck on silly things!
This week I was trying to solve the capitalize challenge and I had it working on ReplIt using a combination of different functions. The problem was that when I copied my code into VSCode, the test kept failing because the challenge required one single function to do all the work. I spent hours and still couldn’t figure out how to use the map() function inside another function. All the googling didn’t help because all the code I was finding was super advanced, requiring nested loops and functions and of course this made me even more confused!
Luckily, the day after Gerard the wizard demonstrated a similar challenge using reverse instead of map() and I finally understood what I had to do. I just could not believe how simple the code was.
This was a good exercise. I wasn’t familiar with the way you can split strings and convert them into arrays, do something with them, and then convert them back to strings. It‘s just a matter of learning the syntax and methods. Thanks to this, I was then able to solve the deBee challenge in literally 2 minutes using the say method.

Superfizzbuzz BOOM!

I was stuck on the “Superfizzbuzz” challenge for quite a while and ended up solving it with a long syntax using a for loop.
A couple of days after I was randomly watching a video where Joseph was using the map() built-in function to solve another exercise. All of a sudden it all clicked and I realized that maybe I could have simply used that for the “Superfizzbuzz” challenge. So I went back to my code and tried it and boom, it worked! It felt super good and I felt empowered like a superhero!

Problem-solving techniques I have been using: