Problem Solving
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:
- Pseudocode: pretty confident and I actually use this technique very often.
- Trying something : way too confident. I probably use this method way too much.
- Rubber ducky method: not so confident. Talking out loud definitely helps me, but I only use it if I am alone in the room. I would never do it in the office!
- Reading error messages : sort of confident. Being able to read and interpretate error messages can be super helpful as they can point you to the right direction.
- Console.logging : I am confident with it but I don’t use it that often, unsure why. So maybe I am not as confident with this as I think?!?
- Googling: very confident. Goggling is my number one way to problem-solve, followed by “try something”.
- Asking your peers for help: not so confident. I am quite shy when I don’t really know someone and it doesn’t come easy to ask strangers for help. I am try to get more confident at this and I have reached out to couple of girls (Lou and Biddy) this week and they have been so helpful and supportive.
- Asking coaches for help : not so confident. Same reason as above.
- Improving your process with reflection: something in-between probably. Reflection is something I never really used before starting Dev Academy. I have now understood how important it can be to retain information, so I should probably use this technique more.