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.
The zeros must come in the order they appeared in the original array. There is no specification for strings or integers first.
I restricted all prototype methods to be consistent - if you don't need it, then it shouldn't be a problem. This kata is not in seek of a creative solution but rather one for a challenging problem.
I'm assuming you're the other user to flag a minor issue - like I said before, is there anything that's actually an issue other than your opinion on the problem?
You aren't allowed to use arrays. What I meant by
The solution is very simple using language features and/or temporary arrays
is that without the restrictions I've set in place for this kata, finding a solution is not very difficult.I'm under the impression you did not clearly read the description of the kata. There are no "hidden restrictions and caveats". I've clearly stated -
and
That's the point of this kata - to raise a challenge. A subjective feeling shouldn't be the cause of reporting a minor issue.
I made a note indicating the restrictions in both the description and sample code comments. I'll address it better in the description to clear up any confusion.
This kata was designed for a challenge given the restrictions. The solution is very simple using language features and/or temporary arrays. What did you intend to use
.toString()
for?I think I was experiencing tunnel vision on the inc/dec sequences, haha. Nice work.
Yep, that was a bug which has since been fixed haha.
As for finding a solution - you can use temporary values, just not auxiliary data sources such as an Array or Object.
You are correct when saying you need to move all elements each occurrence of a zero.
Thank you for pointing that out! I made an escape error in the regex validation of the source code. I also added comment stripping so it won't be an issue anymore.
Man, I swear we always have such similar solutions haha.
This is genius.
Hey! We're all alike.
My point is that your statement in the Kata description is not entirely true.
Isn't it annoying how "string".replace(find, replace); only replaces the first match of the find string?
This comment is hidden because it contains spoiler information about the solution
That's... bitchin'
So I'm not quite sure why this is incorrect.
Test Failed: Expected: Take one down and pass it around, 98 bottles of beer on the wall., instead got: Take one down and pass it around, 98 bottle of beer on the wall.
I realized after writing this, how fragile it is.
Loading more items...