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.
That's theorically true, but such a case could never return in less than 12 seconds ^^'
if BigInterger n is bigger than 0x7fff_ffff, n.intValue() will overflow.
Beautifull code.
Only a little problem: you are making the conversion form "BigInteger n" to it's "intValue" only to make a loop.
It's not realist to think that the "n" parameter can be so big that you really need a "BigInteger" to contain it, I know. But this is the parameter type established... so it's theorically possible that it happens and the conversion to "int" turns in trouble.
It happened to me with one of my test cases at first, then I had to change my code to accept BigInteger values in n. So I agree with you.
Shouldn't variable
i
also be a BigInteger, due to the fact thatn
is?Calling
n.intValue
might return a value smaller than whatn
actually is.WOW.!
oh man!