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
yes :)
Yes, i just have done some new steps today.
I think you have already done it?)
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.
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?)
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?
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.
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)