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.
Hi, can you explain me how it work xd? Im newbie :(
can anyone explain to me the purpose of this line in this code
"if (line.indexOf(' ') >= 0)"
i know what is indexof. but not in this code
when i tested this code without that line, it gaves me Timeout
bruh, why didn't I think of that.
No
let
?Why did you use this '^(' ')+$' in regexp?
I know it's trivial, but how is mutating the original arrays being accepted as a valid solution?. Likewise for most of the other answers here
Not very performant, though.
I'm also
Now I hate myself.
No
const
?Very similar in pilosophy to my first Solution.
I have two solutions, second is onliner recursive, first is iteration
Expected here saw somthing more cute🙄
in the question, it says that
i
will be an integer, so there is no reason to parseInt() itNice! This is much cleaner than my solution. I like the useage of reduce and replace. I will have to remember to use these more often.
I wrote this solution. I can tell you it breaks two tenets of javascript best practices of old: (1) avoid the comma operator and (2) always delimit blocks with curly braces. Whether these are still as relevant now as they were then is debatable.
I've always held that the comma operator has its place in loop conditions. You should get acquainted with it. But in this case it's the wrong tool for the job. I've virtually never used it before, but I think this is a case for the
do ... while
loop.Loading more items...