I love the new coding challenges. But something I’d like, is the ability to look at other learners’ solutions. This would allow us to see if there might be a more elegant way to handle a challenge. (“Oh, I never would have thought of using a .map()!”) I guess alternately, it lets us feel smug if other learners’ responses aren’t as elegant as ours. Perhaps we could upvote particularly elegant solutions, and they could be ordered by popularity?
you can try to propose this on github
but be aware that freeCodeCamp is not saving challenges for a while now, as they occupy too much server space and is not in the budget, so I am not sure this would be implemented either
Back-of-the-napkin math suggests that the whole database to store solutions would fit on a readily-available hard drive, at least if my guesses as to the numbers involved are close.
_But,_ I’m aware that proselytizing an idea to a nonprofit like FCC eventually results in, “Okay, you do it then.” And, well, I’m still learning. I don’t have any exposure to the back-end stuff I’d need to learn to work with that kind of database.
Something I’ve seen on another site, I’d really have no idea at all how to implement. When you looked at other people’s solutions, you’d see, “Doug submitted: [code]. Larry, Mary, Terry, and 128 others submitted substantially similar solutions.” I can’t even imagine how to determine that two pieces of code are “substantially similar.”
I think it’s a good idea and it’s a good way to learn to read other people’s code and see different approaches to a solution.
It sounds like you are referring to codewars? I would just do that that there, if that’s what you’re looking for. It’s already implemented and designed that way. Not sure if leetcode works the same way?
Might compare the text using a diff or timing them to see how fast they execute.
originally freecodecamp used to store all solutions submitted on the server, and that’s the reason it stopped being possible to save solutions, it was consuming too much resources. Consider it’s not just storage space, it’s also requests to the server to save and retrieve the code.
Plus it’s the amount of people involved. At the time saved data was grewing a few GBs per day
Hello everyone.
I think there should also be an option to report a problem if test cases do not work. For example, my solution for daily challenge for 16th September 2025 works perfectly. But the test cases 2, 3, 4 and 5 fail for some reason, even though the output of my function is exactly as it should be.
Here is my solution for that challenge:
function capitalize(paragraph) {
const re = /[\.*|\?*|\!*]\s\w/g;
const matches = paragraph.match(re);
for(const ind in matches) {
let mat = matches[ind];
matCapitalized = mat.substring(0, mat.length - 1) + mat.substring(mat.length - 1).toUpperCase();
paragraph = paragraph.replace(mat, matCapitalized);
}
return paragraph.charAt(0).toUpperCase() + paragraph.slice(1);
}
there is a way, as for all bugs you can open a github issue. You should first ask on the forum to verify it is a bug tho
have you tried calling your function in the editor? you get an error that you need to fix
The key for me to solving that challenge cleanly was remembering that (a) Regex allows capturing groups and (b) String.replace() lets you specify a function that can do something with those captured groups. That got it down to a one-liner for me (although I actually wrote it in a little more easy-to-read fashion than a true one-liner).
But mostly I wanted to say, your for loop there: I confuse for/in and for/of all the time, but you want for/of here. for/in, over an array, just gives you the indices; for/of gives you the actual values, which is usually what you want for an array. I actually thought your way of “working around” forgetting about for/of was really clever; otherwise I wouldn’t have said anything.
Thanks for the reply @Handsome_Dan
The for loop is okay, I am using the variable `ind` as index to iterate through the matches that where found when checking if regular expression exists in paragraph.
The problem is that for some reason even though the output of my function is correct, the test case fails…
As @ILM said, you’ve got a syntax error. Below your function, add
console.log(capitalize("hello world. how are you?"));
and you should see the error immediately.
It would be nice if you got console output while running the given tests, but
.
Thank you, indeed I did not define the variable matCapitalized .
I tested my function in the browser, but for some reason no error was thrown in developer console.
I also needed to fix the regexp a bit to make it work. Thank you again!
the browser console is not in strict mode
I really like the idea of being able to upvote solutions too — surfacing the ones that are especially clean, readable, or clever could be motivating and educational. It would also encourage people to think about code quality, not just “does it pass.”