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.
HI everyone,
What means k,
what should i make in this Kata
Is it too much to ask why 0 => 7 and 1 => 4 ? Sry but the description is too ambiguous for me.
This comment is hidden because it contains spoiler information about the solution
Could someone please explain how shall one consider the test cases where h == 1 and a > 0?
( JS, probably others )
Fixed tests with only red balls and only black balls would be good, to catch solutions that somehow fail on those edge cases.
i don't understand the task and "Euler transform"
There are lots of Fibonacci-type katas with an O(log n) performance requirement. Here's one that similarly allows for arbitrary coefficients, but also allows for more lags: https://www.codewars.com/kata/5d7bb3eda58b36000fcc0bbb
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
Use of
double
for his kind of task is arguable (but not exactly wrong). All values in domain of this problem are rational numbers, so it is possible to calculate the answer precisely. It could be worth to consider if an approximate answer is indeed preferred to precise one.If you decide to stick to floating point numbers, I would advise double checking that they are handled correctly. Rounding a
double
ton
decimal places and strict equality comparison is almost always wrong and susceptible to rounding issues. It's highly probable that such checks won't work well, and some valid solutions will be rejected (some very basic explanation here).This comment is hidden because it contains spoiler information about the solution