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 is hidden because it contains spoiler information about the solution
It times out because it's slow. Spawning bc 2 times per loop takes too long time. Try to use awk. And remove the code from discussion!!! It would be enough if you mentioned that you used bc but it timed out.
Why everybody is sacrificing readability on shortness of codes? This is so annoying!🙄
My solution's algorithm is pretty similar, but I used descriptive variable names and added comments!
Every programmer can write codes that's understandable by computers,
a good programmer writes codes that's understandable by humans...
Thanks, pal. I need to squeeze 2 more assertions in somehow. :)
Python - There are 9 assertions in the "Longer ones" and the largest number has 14 digits.
Note that
factorial(14)
is87178291200
so any algorithm/approach that tries to usewhat_you_are_trying_to_use
is probably going to be too slow!(Python) Same here, tried many different methods, all test pass, times out at the end.
Basic and "Short ones" tests are executed in 0.3 ms but "Longer ones" still times out after 7 assertions.
Does anybody know how many assertions are in the "Longer ones" in total?
Also, how big is the bigest number in the "Longer ones" test?
How many ms execution do I need to achive at "Short ones" to finishing "Longer ones" on time?
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
You can use this "trick" in any translated language of this kata. So I'm sure it's a valid/expected solution.
Cheating!!:)
It wouldn't be 6kyu level kata if you could use anything like
BigInt
.This comment is hidden because it contains spoiler information about the solution
After 2 years you still did not update and made me waste lots of time >:(
Well,
if
condition has binary outcomes. So one can always solve any complicated problems with writingif
conditionsn
times. :)Regex has such a huge power I always have to make this conclusion. If you're regex expert, you can solve string challenges so nicely like you did!
Loading more items...