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.
This comment is hidden because it contains spoiler information about the solution
wtf dude...
this site might be inspirational, but it's rarely a good idea to blindly copy code from 99% of the solutions.
Regardless of it being marked as "best practice" or whatnot.
Ok I tested it against 7 other solutions, once I reached string lengths around 30,000 there was a sudden loss of competitiveness from a midling 4th place to last place and three times slower than the next closest, at 300,000 it has reached about 30x worse
I get that it's a coveted oneliner but someone at least ought to point it out before you start cutting up Billion character strings. it's kind of irrelevant at the current scale also it seems like one of the faster one line solutions
https://xkcd.com/1691/
This comment is hidden because it contains spoiler information about the solution
Yes, it seems is shorter code but the operation every cycle could make it slowest.
Because the range stop is equal to the length of the input string rather than the length of the input string plus an underline character, and the range step is 2. Suppose you had the even-length string "abcdef" -- no matter how many characters you added to the end of it, with a range stop of 6 and step of 2, i is going to loop through 0, 2, and 4 only.
if if the original string is even, then the added '_' is outside of
the range we check
This comment is hidden because it contains spoiler information about the solution
thank you, ctrl+r worked (learned something new lol), regular refresh was not working for me.
It happens sometimes, but recently it's not as common as it used to be. When it happens to you, try hitting Ctrl+F5 or Ctrl+R in your browser to perform "hard refresh" of the page - usually helped for me.
What wrong with the site? when I go to do a solution the solution windo is blank and the testing windo has a generic "testsomething" function that does nothing.
This comment is hidden because it contains spoiler information about the solution