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 comment is hidden because it contains spoiler information about the solution
and yet I like my solution better
This comment is hidden because it contains spoiler information about the solution
Codewars only allows you to run code for 12000ms (12s) per test. It says in the description that it will be tested with large numbers; your code takes over 12s to run on large numbers.
In some languages, it's also exponent.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Gotcha! I'm still very new. Thank you for explaining why I was having issues.
The 2 random tests use the same array, so you've mutated it in the first one, and failing the second one. It test 'value' and then 'index'.
I console.logged(arr, toReturn) in the test and copy/pasted the array so I do not believe I mutated the array.
Maybe you've mutated the array? That one seems sorted.
Edit: Yes, you did. Do you realize that the index of the minimum of sorted and original arrays will be different unless it was 0 to start with?
One of the random tests is flawed when finding the index position. I ended up resubmitting a few times till it passed. Once it passed I copied the first top three code to "train again" to see what I missed and all three of those failed the one random tests as well.
console.log(min([-366,21,116,120,140,162,175,194,219,223,243,254,347,365,393,402,408,411,440,473,474,477,551,597,602,633,640,651,669,709,740,743,761,781,784,799,805,827,881,885,908,911,928,939,945,949,958,964,965,975 ], 'index'), 13) The tests wants index 13, but the smallest number is clearly -366 which is at index 0.
Am I missing something with this kata?
How many reverse a string kata's are in codewars...?
The type of rounding is not mentioned.
This is no different from "Multiply" kata (except here we have to use quotients given by their name, but that's also covered in here).
Loading more items...