• Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    I've never seen .match() before, time to do some research! Nice solution :)

  • Custom User Avatar

    Fixed for Python

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

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

  • Custom User Avatar

    I did it with memoization on Ruby: maybe are you trying a wrong approach? Feel free to ask if you think I may offer some tip or suggestion :)

    Recursion is too slow/heavy for bigger numbers, while I don't know any way around the math approach (I assume you mean using a Binet-like formula).

  • Custom User Avatar

    Sorry that no one answered this question before. It's a nice kata.

    When you're editing your kata, there are four different tabs in the lower left:

    • "Complete solution" needs to contain your solution and needs to pass all your tests for the kata to be valid.

    • "Initial solution" should not be empty, but contain a skeleton that the user can start coding in. Normally, you would just put an empty method here with the correct name.

    • "Preloaded" can contain code that is accessible to the user when solving the kata. But since the user can't see this code, you need to document it in your description. It's mostly empty.

    Note that when you run the tests, they are run against whatever code you have active in this window. So before you save your kata, run your tests against the "Complete solution."

    Let me know if you have any more questions and I'll try to answer them as well. :-)

  • Custom User Avatar

    Solving this in Ruby:
    Recursion: passed tests, timed out on submit
    Memoization: passed tests, timed out on submit
    Math: passed tests, passed all submits except very high values (where I am assuming floating point becomes inaccurate)

    So basically, a challenging Kata (for me anyway :)) ... I'm tempted to look at the solutions but also want the satisfaction of solving this on my own. Any hints on the right direction? Is there an approach I am missing?

  • Custom User Avatar

    Nice solution.
    It helped me find some missing test cases. (sorry)
    But thanks.

  • Custom User Avatar

    Fun kata. My original brute-force algorithm was too slow so I had to think about this one a bit. Thanks for the challenge :)

  • Custom User Avatar

    I have few katas back here at my computer but I'm not uploading them on CW right now, I'm waiting to learn a new thing with String.prototype.replace() and use it in them and then I will upload all the related katas at the same time as The katas from #12 to #15 are related to each other.

  • Custom User Avatar

    No worries & I have done multiple of your series! Keep them coming, I will upvote.

  • Loading more items...