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.
!
is a regular character in JS regex, but?
is a special character (the "zero or one" quantifier in this specific instance) which has to be escaped./!/g how did it work without scaping like this /?/g
your solution upvoted (clever + 1)
Thanks a lot! Fixed!
Probably a (O²) algorithm will not pass the tests
Complexity notation doesn't work like that, it should be
O(n²)
.Thanks for your solution, upvoted (clever +1)
countourMode = countTourMode, it should be :)
The function name is misspelled in JS (should be contourMode).
Just think about 1000 bottles of whine
.LOL. I suppose the King can store them in the palace cellar along with his 50 barrels of grizzle, 20 tubs of whinge, and that giant vat of moan that nobody wants to go near...
:-)
This comment is hidden because it contains spoiler information about the solution
You are right.
it was only in the python translation - now it's fixed.
thanks.
This comment is hidden because it contains spoiler information about the solution
The ECMAScript standard doesn't specify and V8 (NodeJS, Chromium) doesn't guarantee stability, so this is expected.
I haven't looked at the source, so I'm just guessing, but probably the sorting algorithm used depends on the length of the array. Switching to unstable but faster one for larger array.Looks like in-place quicksort and insertion sort is used (v8/src/js/array.js#L709-L1002).
Interesting Kata. I've discovered a quirk about the javacript
Array.prototype.sort
method, that sometimes re-arranges array items in an unexpected fashion. For example, when implementing the following code, the expected result is returned.However, the longer random examples in this Kata appeared to break this pattern, and equivalent length strings were rearranged in the array after the sort method. I'm not able to explain this behaviour.
Loading more items...