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 has been deleted.
and where do you find a flower with over a billion petals?
will not work if (flowerA + flowerB) > Int.MAX_VALUE :)
beautiful
Gotta agree
Not sure on processing, running two mods is probably more expensive computationally than an addition and a mod
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
I've never seen the import just in the code block, true one liner!
perhaps you're using a hammer for a screw?
Why did you import a ridiculous list of apis? lol
hahaha is this all the eureka numbers there are? +1 for cleverness.
Nicely done. very clever one liner.
You only actually need to look till the sqrt of your number, after that factors repeat as multiples of smaller factors. Additionally you only need to look at either odd numbers or for even more optimized search, after 2 and 3, all primes will be 6k+-1... ie 6(1)+-1 = 5,7(primes) 6(2)+-1 = 11,13(primes) 6(3)+-1= 17, 19(primes) 6(4)+-1=23,25 (prime not prime), not all numbers in the 6k+-1 range are prime, but all primes can be represented as 6k+-1.
This is because all numbers can be represented as 6k-1,+0,+1,+2,+3,+4... after checking for 2 and 3, you can also remove +4(factor of 2), and 0(which is 6 factored by 3) leaving just 6k+-1