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.
Fixed.
PS: I don't have enough time to modify all my Rust translations. Please don't give the names which are to be modified... Saying about snake cases is sufficient:-)
Thanks. Fixed for this one.
This comment is hidden because it contains spoiler information about the solution
In the Rust examples the function name "multiply" is used but in the final submission the function name is "solution".
34 guys had passed the Rust kata without any problem. Something has changed in the CW CLI runner, I think.
I modified the name. Hope that now all is well.
Thanks for your post!
This comment is hidden because it contains spoiler information about the solution
Actualy the expected result should therefore be 0. In my opinion it is quite a relevant test case, since the expected behaviour is explicitly stated in the description.