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.
There is a difference between "each handler will be subscribed at most once at any given moment" and "each handler will subscribe at most once".
It seems you are reading the second meaning into the first wording.
If you subscribe the same function twice, it should then be subscribed once.
If anybody has a suggestion for a clearer description, please raise that. Closing this issue.
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.
Thanks! :D
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?
7 kyu
Kata. The user should not be concerned about performance that exceeds theMAX_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 surpassMAX_SAFE_INTEGER
.Why you are testing values higher than
MAX_SAFE_INTEGER
in JS? This make no sense at all in this Kata as7 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
exceeds60
, it easily surpassMAX_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!