Ad
  • Custom User Avatar

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

  • Custom User Avatar

    I have a similar problem but in this case both numbers ARE prime. I double checked.

    (6, 100, 110)

    101 is a prime number.

    101 + 6 = 107

    107 is also a prime number

    My function is returning [ 101, 107 ] (both prime numbers between 100 and 110 with an interval of 6).
    Still, the kata points an error "expected [ 101, 107 ] to deeply equal null".
    I dont understand :(

    Just figured it out. There can be no primes in between.
    Sorry

  • Custom User Avatar

    361 isn't prime, it is evenly divisible by 19.

  • Custom User Avatar

    I'm having the same issue, for some reason the console.log shows that [1, 2, 5] is being passed as the coinDenominations. Only when I console.log it with nothing else on the function does it show as [1,2,5,10,20,50]

  • Custom User Avatar

    Not an issue, it's only available in Node 14. or above

  • Custom User Avatar

    the problem in your code is that Array.splice() is inefficient for very large arrays, because it has to shift all of the indexes to the right of the deleted element. so, calling it in a loop is slow.

  • Custom User Avatar

    Probably, yes.

    Note: due to the randomness of the tests it is possible that you will get unlucky and a few of the tests will be really large, so try submitting 2 or 3 times.

    Check that too ^

  • Custom User Avatar

    Because replaceAll doesn't work in all Node's versions.