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.
Note that this solution will overflow when given a
prod
value higher thanfib(47) * fib(48)
, asfib(48) * fib(49) > u64::MAX
. On a release build, thea * b
multiplication won't panic and the while loop becomes an infinite loop.Granted, the vast majority of solutions here suffer from unchecked multiplications, this one is hardly alone.
Your approach is way too slow.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution