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 kata is a candidate for retirement as it relies on contraints which are not enforced well, and are very difficult to enforce. Please join the discussion and share your opinion on whether this kata should be kept, or retired: https://github.com/codewars/content-issues/issues/167.
My first 4. But it probably too easy for a 4. There's even 7kyus harder than this. Anyway, enjoyed it.
You're welcome.
thank you for help
Expected: '[1,"0","0","0",0]', instead got: '[1,"0",0,0,0]'
i got only 1 false mixed test but i can't see the input so i don't know what the problemis
crazy 4kyu
wont even let me use shift and pop.. darkness
in older javascript versions,
Array.prototype.sort()
was not guaranteed to be stable.Yes, it's a Node specific issue, and not really a kata bug.
You assume that elements which are not meant to be moved will stay on their original relative positions, which is not the case with
sort
in Node 8.sort
can, in case of Node 8, reorder elements in any way as long as the final ordering satisfies requirements of your comparer. With input of[2,0,7]
it's perfectly fine to get the sorted result of[7,2,0]
.This comment is hidden because it contains spoiler information about the solution
Use something like bubble sort but make it sort not-zeros and zeros.
A temporary array/object is a place for you to store values and then stitch them together again.
I assume the kata wants you to implement a sorting algorithm... unless it thinks comparisons should also count as a temporary object, in which case, I am at a loss.
Ranks of approved katas cannot be changed, so please don't complain about that and enjoy the cheap points.
a good kata, but i think it would've been better if it was 5kyu or 6kyu
Loading more items...