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.
In maths ( and Wikipedia ), this is called "partitioning".
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
.note: put a language specific note saying all results will be under
MAX_DAFE_INTEGER
, then, so that users don't try to useBigInt
. Otherwise they'll still get the same error message.Either test under
MAX_SAFE_INTEGER
or requireBigInt
results (but then existing solution will be invalidated). It is a "7 kyu" kata so testing underMAX_SAFE_INTEGER
is a reasonable choice.should i test only under the MAX_INTEGER what say?
It is not possible to solve this kata in JS with BigInt results. I get the following errors:
I think it is possible to support both
Number
andBigInt
results with a custom assertion. But I do not recommend to supportNumber
results because these results are not precise for large input values.BigInt has been added to support big numbers.
fixed
BigInt should be used in JavaScript:
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
.Question
And how is this a kata issue?? You can ask questions under any specific solution, if that helps. Closing...
Edit: what the hell, sorry. It was showing up as issue to me. But you should use spoiler flag for questions like this.
You can search about fibonacci ladder problem where length of steps not greater than 2. Then think about generalization of this problem.
This comment is hidden because it contains spoiler information about the solution