• That is very clever, i wonder how did you guys figure it out

  • Hey! I think I'm stucked here.

    My solution seems to pass all the tests and I've already optimized the prime verification and used memoization for finding all the possible values. Is there some trick or some specific approach?

    My solution is passing the Basic tests with completion time near ~5017ms.

  • good stuff, keeping the run time lower :)

  • fixed

  • I'm not here to complain and I really liked the Kata but I have some opinions about it and why I think it can be improved (and how to do it).

    It's pointless test cases using numbers above MAX_SAFE_INTEGER in JavaScript.

    Why?

    1. A real solution using recursion breaks as 'max call stack' as it is pointed out by some users in comments
    2. There's no point requiring use of BigInt and not cite it as required in Desciption (as long as I think this is not necessary)
    3. This is a 7 kyu Kata. The user should not be concerned about performance that exceeds the MAX_SAFE_INTEGER

    My suggestion is: I hardly recommed to maintain the range of numbers as

    • 1 <= n <= 50
    • 1 <= k <= 30

    At least for JavaScript. JavaScript do not have full memory to store numbers like Python and if n exceeds 60, it easily surpass MAX_SAFE_INTEGER.

  • Why you are testing values higher than MAX_SAFE_INTEGER in JS? This make no sense at all in this Kata as 7 kyu... Numbers above that are not precise and the values exceeds the time of execution or do not pass the tests.

    If possible, can you make the test with numbers below MAX_SAFE_INTEGER in JS?

    As a suggestion, I hardly recommed to maintain the range of numbers as:

    • 1 <= n <= 50
    • 1 <= k <= 30

    At least for JS. JS do not have full memory to store numbers like Python and if n exceeds 60, it easily surpass MAX_SAFE_INTEGER.

  • Fixed.

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

  • Hey! I think this kata has some issues in JS version. Most part of it is result of trying to subscribe() the same function more than once and the TESTS(at attempt) are considering this valid as the description says this is not valid.

    Here: "each handler will be subscribed at most once at any given moment of time. It can still be unsubscribed and then subscribed again" at Instructions says that this is not possible but the 'attempt' tests are doing this.

    If possible, consider correcting this :)

  • For me, I done the correct solution but takes too much time to reach a solution for the large numbers... /sad

    I'll let this one for later and keep coding another katas!