Ad
  • Custom User Avatar

    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.

  • Custom User Avatar

    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.

  • Custom User Avatar

    Quite the response time you have there haha. Only 6 years! It was in JS though.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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.

  • Custom User Avatar
  • Custom User Avatar

    Yea, this is from a few years ago when I was first learning JS.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Total dick move. You owe me half an hour of your life.

  • Custom User Avatar

    ....................Total dick move. Whoever made this Kata owes me half an hour of their life.

  • Custom User Avatar

    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.

  • Custom User Avatar

    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]'

  • Custom User Avatar

    With the "i" tag you don't need A-Za-z, i stands for case insensitive

  • Custom User Avatar

    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...'

  • Custom User Avatar

    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...