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 will fail any time the array contains duplicates, as you're finding the min and max integer in the array, then filtering them out. So say the array looks like this [1, 3, ..., 98, 99, 99], your first iteration will use (1, 99) for minValue and maxValue, but your second would use (3, 98) as the other 99 has been filtered out. Try using array position instead of value.
Feel like it should state in the details that you can only use each integer once. At first I thought it was asking for the smallest sum of the products of every possible combination of the integers.
Quite the response time you have there haha. Only 6 years! It was in JS though.
This comment is hidden because it contains spoiler information about the solution
Probably because it uses a double ternary. Code needs to be easy to read to be maintainable. If the input array was very long, you'd also want to use a for-loop instead of recursion, as recursion has more overhead and is slower.
What do you mean?
Yea, this is from a few years ago when I was first learning JS.
This comment is hidden because it contains spoiler information about the solution
Total dick move. You owe me half an hour of your life.
....................Total dick move. Whoever made this Kata owes me half an hour of their life.
You know you could just write switch(S) and use case 0:, case 1:, etc.. instead of having to write case S == 0:, case S == 1:, right? Not quite sure what the 'true' is in there for lol.
Failing a bunch of the random test cases in JavaScript, though as far as I can tell the expected and the output are exactly the same. Is this a bug or am I missing something?
Expected: '[96, 8, 87, 76, 71, 46, 96, 95, 52, 75, 17, 92, 76, 99, 51, 81, 45, 33, 90, 74, 17, 10, 96, 60, 10, 79, 0, 11, 7, 13, 35, 15, 99, 80, 79, 16, 2, 34, 17, 6, 63, 58, 68, 71, 2, 61, 67, 70, 3, 19, 83, 42, 87, 89, 59, 29, 54, 1, 62, 60, 59, 70, 15, 81, 45, 37, 7, 50, 59]',
instead got: '[96, 8, 87, 76, 71, 46, 96, 95, 52, 75, 17, 92, 76, 99, 51, 81, 45, 33, 90, 74, 17, 10, 96, 60, 10, 79, 11, 7, 13, 35, 15, 99, 80, 79, 16, 2, 34, 17, 6, 63, 58, 68, 71, 2, 61, 67, 70, 3, 19, 83, 42, 87, 89, 59, 29, 54, 1, 62, 60, 59, 70, 15, 81, 45, 37, 7, 50, 59]'
With the "i" tag you don't need A-Za-z, i stands for case insensitive
Passed all tests in JavaScript, hit Submit Final and then it takes me to a page that says 'Solutions Witheld... haven't completed blah blah...'
Btw, generally when writing Morse code you represent spaces between words with '/', whereas when you're actually trasmitting it's just a longer pause.
Also, when testing in JS I get this:
✘ Expected: '.... . .-.. .-.. --- .-- --- .-. .-.. -..', instead got: '.... . .-.. .-.. --- .-- --- .-. .-.. -..'
Those look exactly the same to me... So I'm not really sure what's going on here?
Loading more items...