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.
Because "their digits are in increasing order (the numbers may have two or more equal contiguous digits)"
And '1 < 0 < 9'
And '9 < 0 < 1'
are false~
they all have the discuss button. If you don't see it, resize the window in your browser.
https://www.codewars.com/kata/the-millionth-fibonacci-kata/discuss/
@zrhhust don't post code here, it can't be marked as having spoiler content, and why didn't you use that kata discourse in the first place?
I your code takes ~45s for
fib(1000000)
, then it's too slow. There's a few tests with large numbers, largest being ~1000000, and you have only 12 seconds to execute all of them.What
n
did you try on your computer? How long does your computer run your solution for n=-20? How long does your computer run your solution for n=1000000? Why did not you post a question in the kata discrouse?