Help with forum and adding new solutions to challenges

Hi guys,

I need help with understanding how the forum works when it comes to solutions to challenges.

I was working at this challenge in the basic algorithm javascript:

and I came up with a solution I’d like some feedback on, as I could not find it on the forum. But it doesn’t let me comment or reply to other comments on the solution page for that challenge. So my question is how do I get some feedback on this solution? and if it is a good solution, eventually how do you get it added to the solution list?

I will copy the solution below:

function mutation(arr) {

  

  var filtered = arr[1]             // get string from array at index 1//

                .toLowerCase()     //make the string lower case//

                .split("")         // split the string in single characters //

                .filter(letter => arr[0].toLowerCase().includes(letter)) // get a new array of characters that includes ONLY the characters that are also present in the string at index 0 of the array after turning it to lower case //

                .join(""); // join the characters back together to create a string //

                

  return arr[1].toLowerCase() === filtered;  // if all of the second string characters are present in the first string, the string will be unchanged and when compared to string at index 1 turned to lower case it will return true, if not all characters were present the string will change and the variable filtered will not be equal to itself turned to lower case before applying all the methods above, and it will return false //

}

Well, you can always just ask in the general solution.

I can’t speak for everyone and don’t know what the official policy is, but I’d be worried about the solutions page getting clogged up with solutions. People often end up suggesting solutions that are slight variations of existing solutions. And sometimes (imho) people offer solutions that are just trying to be clever and could be a distraction to learners.

1 Like

The solutions threads are locked because a lot of people thought that they should put their solution in the thread, whether it was identical to another one or not. They very quickly got extremely out of hand.

If you ever see an error in a solution thread, you can create a post in the Contributors section explaining the issue and proposing an improvement.

If you have written a solution to a challenge and you’d like to get feedback on how you might improve it, then go ahead and create a post in the relevant section (JavaScript, Python, etc) and tell us what your process was and what you’d like us to look at. If you do this, just put your solution inside [spoiler] tags.

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.