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.
It's hard to answer without spoiling the solution. 1/4 is the initial value, it's in C0 ([0,1]). For C1 the value you must control is no more 1/4, it changes on each iteration.
Yes it is.
@zhiburt, Yeah sorry...
Translations of my Kata must be same as original (or as much as is possible for the language) else I won't approve them. So that means same kind of Random Test code too.
Not speaking for Dinglemouse but speaking for the quality assurance team at Codewars: this should not be approved then.
Learn how to do random tests. Have a look at how Rust kata you have solved do it ( you can ), and steal from there what has already been invented. Copy the actual logic from the kata.
Random tests really are essential to have.
Fixed
fixed, thanks!
Nobody can give you any hints without seeing your code. As B4B said, the linear solution (if we ignore the fact that arbitrary-length math affects the performance) takes approximately
1 - 1.5 sec
in all languages, so your solution is a lot less efficient than you think.it cannot be O(n) because the expected O(n) solution passes the tests in something like 2s. So you must have missed something that makes your code O(n²).