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.
This comment is hidden because it contains spoiler information about the solution
I repeat: even if the function has a single line: "return BigInteger.ONE;" the tests still time out.
How can I unconditionally return number 1 more efficiently than that?
After months (if not a full year) of having a correct solution in Java, I was finally able to submit it without any timeout on http://preview.codewars.com/
On the normal site, even a solution along the lines of "return 1;" would timeout.
There are no tests for the following requirement: "Operators are always evaluated from left-to-right".
Some of the solutions were accepted even though they evaluate "1 - 2 + 3" as 1 - 5 = -4 (instead of -1 + 3 = 2).
I've used the basic k-means algorithm which worked very well for all test cases but the last one.
I think the case has been generated using too strong Gauss smoothing. Taking a look at first group of ones and the following group of zeros in the bit string, their length differs only by one (a small fraction of their length), but one group is supposed to represent 1 time unit while the other 3 time units. I think many different applicable methods would have to be really fine-tuned to correctly decode a message this 'noisy'.
Your solution is easy to understand, but I fear it relies too heavily on the way you set your initial conditions. I wonder if you'd get the same result if you'd decode the message in reverse order for example.
Overall, I liked the Morse journey. It made me to dust off my rusty Python basics just to get through the last part of the trilogy. I'll welcome any tips on why my classic k-means implementation didn't work here.
I've just successfully submitted a solution for a different kata in Java - no hiccups. Immediately after that, I went to submit the following trivial solution here:
fib(BigInteger n) { return n; }
Submission timed out
The tests do timeout even with the following function:
fib(BigInteger n) { return n; }
How do you deal with the timeout problem from there?
This comment is hidden because it contains spoiler information about the solution
The first 'd' in italics suggests that it was surrounded by stars which were interpreted as formatting.
So, the formula 10 * d * d actually is:
The series from the example 10, 40, 90, 160, ... gives it away too.