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 is absolutely horrifyingly terrible and I love it.
Just trying to avoid the timeout by avoiding redundant calculations across many tests.
So, this guy just hacked the testing sytem with the cache. Well, that is cool, in some sense
So instead of solving for the divisors efficiently, you set up a CACHE specifically designed to accomodate multiple tests done in a row rather than checking if one test done at a time is done efficiently. That's cool, you leverage the fact that many of the tests ask you to check the same number for having the property.
you did really good in some parts but check my solution and you'll find out which parts you cpuld have done better. anyway you gave me some ideas for future. Thanks!!!
Don't work if n is non digit!
with float may return an error!
I guess original tests were not so harsh
if n is anything other than an integer or integer-formatted string (e.g. '123') that is >=0, throw a TypeError
Read the problem description.
This does not correctly handle floats.
My solution has five lines and still fast :P
Check my code for a more optimized version of your def get_sum
This is fishing, not caching!!!
The search for divisors, however, can be greatly optimized with the upper bound of sqrt(number) + 1
Check my solution guys. Twice faster and have no cheats.
The cache will save over time because you only run the first line of code just once, after that all the test are using by calling the function with different numbers.
Using the dict CACHE helps u jump over test you have already done in the previous so it s faster.
Chances are thinked the same way he did but by not using cache you are wasting time on useless tests.
Loading more items...