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.
Very fun man, good stuff.
Not a kata suggestion!
The description says:
"Your memory tape should be large enough - the original implementation had 30,000 cells but a few thousand should suffice for this Kata"
and:
"The memory pointer should initially point to a cell in the tape with a sufficient number (e.g. a few thousand or more) of cells to its right."
However in C# at least, no test case requires more than 15 memory cells. Even if using the same memory tape for all tests without ever clearing it or winding it back, only 24 cells are needed. If this is intentional, the description's references to requiring thousands of cells should probably be changed
',' means to copy the next unused byte from the input string to the data cell at the data pointer. '+' means to increment the value of the current data cell.
The input is separate from the "data" which acts as temporary memory.
While this would have been better posted as a suggestion, I agree that the description could be clearer for people who don't already know how it's supposed to work.
Execution times out for me.
Interestingly this is ~5x slower (run by CodeWars at least) than Garcian1991's almost identical solution, just substituting ElementAtOrDefault for ToArray.
Brilliant!
Weirdly both worked for me. Did someone edit it?
imho the wording of the description is unfair. I suggest changing to:
"You have to return an int Array filled with numbers from 0 to 3999999
The numbers have to be in ascending order.
But there is a problem. You have to do this very very very very quick."
It might be worth making some mention of compiler choice in the description. My solution fails on Mono (it defaulted to Mono for me), but completes in less than half of the required time under .NET 8.0.
Iteresingly this seems to run very significantly faster on Mono, via this site at the time of writing at least.
Ok, before submitting I wanted to give you guys a hint you might struggle to figure out:
if the input string is Null oe Empty, it should return true.
Also it is worth specifying this information in the description.
Removed
called
. The function's name changes between languages and can be seen in the initial code."Write a function called that takes..."
Possible typo?
Loading more items...