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.
"You don't necessarily start at the first floor" Exactly! Now I understand what the mistake is :)
I was also a bit mystified by length = 0 in the random tests.
I imagine if the length of the segemnt to be sorted is 0, then nothing gets sorted.
Instead the tests expect length=0 to result in everything from start to the end being sorted
That aside, thanks for the kata
---- this from test results ----
Testing for [46, -90, -30], 0 and 0
[46, -90, -30] should equal
[-90, -30, 46]
Well done. Frog exor
^_^
Hmm.. the point is, you don't need
i++
, throw it away~~ you should jumping in the array like a lonely frog^_^
Your algorithm should be faster than O(n)
, description said. ;-)This is a hint.
And how to find out a faster algorithm?
All the elements are 1(absolute) difference from its neighbors.
description said. ;-)This is your weapon.
Just re-submitted my solution, and got
Your code running in range 0ms - 3ms
As you can see, my slowest time is 3ms. So it's safe enough
^_^
???
Your code running in range 0ms - 14ms
means: In the performance tests, your fastest time record is 0ms, and the slowest time record is 14ms(perhaps meeting some worst case). So, it just a notice/count/recorder for your code.You need to optimize your code so that it runs steadily below 6 ms. ;-)
Perhaps that means you were not using the correct algorithm ;-)
I'm glad you enjoyed the Kata @exor. It was my pleasure.
Thanks. Happy coding
^_^
Another sad story ;-)
perhaps your code spent more time to determine which situation is. ;-)
Yes, i did that and now it seems fixed.
Maybe exor still has the old sample test cases? You could try resetting the kata editor, which will also update sample test cases.
How is [5,2,4,1,0,3] a Madhav array? This solution returns false as it should considering
Loading more items...