What to do if I accidentally saw the solution?

I got stuck in this challenge https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-javascript/stand-in-line and so I was checking the forum to look for better explanation. Instead I got myself spoiled with solution to the problem and lost the opportunity to learn the lesson and problem solving in general.

What will you do if you saw the solution by mistake?

1 Like

This is a very basic challenge where explanation and solution are kinda the same thing, so just make sure you understand what methods used in solution do and you’re good!

Later, when you will meet more advanced problems, this also won’t be an issue actually, because there are enormous variety of possible ways to solve any problem. For example, try to implement nextInLine(arr, item) in two more ways:

  1. Purely imperative programing (intermediate): no methods allowed!
  2. Codewars style (advanced): function body must have only one line that starts with return

As you can see, you can challenge yourself further with any problem

1 Like

Go have a snack, stretch your legs, then come do the challenge. If you remember the general concept of the solution, that’s no big deal. Just keep working. We do try to prevent this from happening by removing or blurring solutions, but we don’t catch them all.

2 Likes

It’s good to hear that I have nothing to worry about as long as I understand it and liked your suggestion on stretching the problem a bit further. You’re right about finding more than one ways to solve as this is exactly I experienced in another challenge.

I’ll wait for 3 days and see if I will be able to remember the solution right away. If you are curious, it was from this forum that I saw the answer by mistake. Maybe it’s good idea to blur out the codes to prevent future campers from seeing the answer.

if you saw it on the forum you can also flag it to notify a mod the need to hide it so that others will not see it accidentally too

1 Like