Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Interesting approach lol, clever
While using reduce looks cool, it is better to use simple for loop wherre you can stop once you found the first marker
its seems simple and readable
could anyone explain why my solution works slower than this one? It looks like it's not supposed to be so, but I can't find out why it is
Terrible decision, so here the time complexity is O (3nm2k), when you can do it in O (2n), I don’t understand why someone liked this decision
the details for assignment was to trim the trailing end. you trimmed the leading and trailing end. this would mess up and lines of text that started with spaces
This comment is hidden because it contains spoiler information about the solution
why the [0] here? Can someone explain?
Smart solution! Thanks
I like the terseness of this solution but it does not cover the case where a comment marker is included within a string literal in the code, like
"console.log('this is a js comment: //') // real comment"
Instead, this solution will return:
"console.log('this is a js comment:"
This isn't a requirement for this problem so maybe I'm being pedantic, but it's a good thing to consider for this type of parsing. Either way, nice solution.
arr = [1, [1, 1]]
arr2 = [
[2],
[2, 2]] are not the same.This solution is wrong
replace works a little slower
bad
Why
👍
Loading more items...