Ad
  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    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?

  • Custom User Avatar

    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.

  • Custom User Avatar

    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).

  • Custom User Avatar

    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.

  • Default User Avatar

    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

  • Default User Avatar

    The tests do timeout even with the following function: fib(BigInteger n) { return n; }

    How do you deal with the timeout problem from there?

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Default User Avatar

    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:

    10 * d * d
    

    The series from the example 10, 40, 90, 160, ... gives it away too.