Ad
  • Default User Avatar

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

  • Default User Avatar
  • Default User Avatar

    Yes, i just have done some new steps today.
    I think you have already done it?)

  • Custom User Avatar

    can someone explain me why fib(-n) is equal to fib(n) when n is odd? I noticed this when I submitted my code and corrected my code for this, but I feel stupid for not seeing why I should do this in the first place.

  • Default User Avatar

    Wow, that's a bit too much indeed :)
    By the way, I too have problems with this Kata, my problem lies more in the accuracy at larger values. So I got stuck at fib(-96)
    You may want to search the internet for approaches with which you can directly calculate fib(n) for any n.
    (Is this is a spoiler?)

  • Default User Avatar

    Hi! RVdeKoning, thank you, i've tried fib(-2000000) and it had reload my computer. Really mistake is in my code.
    How do you think, it would be better if i remove my comment?

  • Default User Avatar

    Hi Romandotnizin, I think your code is correct for the simple examples, but your algorithm is not good enough to find the solution within the time limit. Don't forget that a million fibonacci numbers is a lot, that takes time! Hence, 'brute force'-codes don't always work and you should try to optimise your code.

  • Default User Avatar

    Hey, i'm new in codewars. Can somebody tell me, why my own tests have finished for a ~ 77 ms, but if a click "submit" it spends to much time for loading, more than 6000ms. Example of my own tests(i think thay are similiar to "Submit" tests):

    fib(-90) fib(-91) fib(-105) fib(14)....and it goes on 20 times and if i simply test it everything is right the same ~77ms.

    But when i click 'Submit'. i say '..... you'.
    So why does it goes wrong way? Or server is too busy? (i simply use if, while and unless)