Basic algorithm scripting(javascript)

Hello, this post isnt a code specific. But i have an overall problem with this topic.
i restarted entire javascript session 3rd time now, to come and get stuck at this basic algorithm scripting section. I am insta stuck on the very first topic. Like, it asks to reverse a string, but as far as i can recall the previous topics do not walk you through the reverse join and etc functions. but in this case you have to use it, as i have searched the answers after the struggle. And this is the easiest, later scripting is harder and harder. i feel so mad at myself that i am stuck here for almost a month. i need some help or advice on what to do please.

Thank you in advance,
Temo

Your browser information:

Chrome

Challenge: Reverse a String

Link to the challenge:

you can do it with a loop

but, yes, this section is hard.

make sure you understand the input and corresponding output, and then try to make the steps on pen and paper, without any JavaScript. Once you have the algorithm working there, only then you translate it to JavaScript.

It’s hard, it requires a lot of practice, a lot of grith and frustration. But you can do it. Also, use Read-Search-Ask as needed, but if you can, do not look for full working solutions, try to arrive there on your own.

1 Like

i have been trying to overcome the algorithms for the past1.5 months, been doing coding mostly everyday for 4~ hours. but as soon as i come across algorithms, i just hit a brick wall. Also i feel like the fcc explanations are a bit dry in this regard.
How do you practice? maybe you have your way which you can share with me

1 Like

Hey @Temzarone!

Both of the algorithm sections require a whole other skill set of problem solving. It is ok to feel frustrated with these problems because you are brand new to this type of skill set and it takes time and practice. Eventually you will develop a process for problem solving and it will become easier. It did for me.

Here is my process for solving coding challenges.

  1. Step away from the computer and get some pen and paper. (This is an important step and should not be skipped)
  2. Paraphrase the problem in your own words to make sure that you understand it. (If the wording of the question is confusing then look at the FCC test cases and try to see if there is a pattern)

  1. Solve the problem away from the computer.
    Forget about code for a second and ask yourself
    How would I reverse a word?

Well you would naturally look at the last character of the original word and put that character in the beginning of a new reversed word right? Then you would repeat the process working from the end of the original word to the beginning and adding it one character at a time to the new word. Then you would stop when you have run out of characters.

4.Make sure to write out step by step how you solved the problem
This is important because you will use these steps to help you turn it into code.

Now that you have solved the problem away from a computer, then you can move back to your computer.

Go through each step of what you wrote out and look to mdn docs to help you along the way.

When I went through both algorithm sections, I relied heavily on mdn docs to look up array methods, string methods, as well as other things. Use that to your advantage.

Hope that helps!

4 Likes

Same here, BUT, its the way it meant to be. You must develop the habit of problem-solving skill. Do not try to get the answer just on FCC, search, read, think, code.
Cheers!

2 Likes

Thank you for finding time to give me advice on my current issue.
I feel like i can do that, because during learning i am used to using my notebook and a pan to write down everything i learn ( it helps me to remember things very well). Thus, writing down my thoughts and then transfering them into a code seems to be a great solution( and yes, my browser is full of MDN links right now haha) Thank you again and i will follow these steps from now on! Have a great day

1 Like

thak you, i will take into consideration all the advices you guys gave me. have a great day!