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
I did.
:[
I made a js translation, ofc you can check the restrictions :)
Restrictions are unenforcable, and task is not novel anyway. I doubt if it's worth the effort.
Bitwise shift left and bitwise shift right.
That's what it want's you to use.
I guess this looks like an issue... what language is it?
why?
Post a solution with spoiler tags please.
Great for all n <= 10^8. Try it with 10^9 and show what happens. It must take a few seconds to run .
thanks, but duplicate issue, see below
You need to increase the upper bound of
n
. It can be done in two ways: useBigInteger
for results or ask to return values modulo some number (i.e., instead offib(n)
returnfib(n) % m
wherem
is some big prime number, e.g.,m = 179424673
). I do not recommend to publish a new version of this kata because it will be retired as a duplicate. It is better to translate an existing Fibonacci number kata.With the
int
data type it is always possible to hardcode this problem: link.Yes i like it.