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.
you will change opinion when you will see that in fact, recursion is the only one way to go with for fast.
IMHO, any solution using recursion should be rejected.
Sum over a range is
O(n^3)
? You should work on your knowledge first before "teaching" others.ho ok, i'm surprise but well... i have to work more on this. Thank you for check my code and provide an answer.
Not an issue, yes. @jerome: you need something more efficient (it's not about optimization, tho. It's about finding a better algorithm)
Your solution is O(n^3), pretty slow. It needs optimized.
Also, this is a question, not an issue.
look at my code, i didn't calculate the factorial and solution is a mathematical sum who is very quick... it should not refused due to server time error... also, what does server time error has in relation with an objective test ? I missunderstand the idea, because if the server has a full load, what does it happend ? you trash users who provide an efficient solution ?
This comment is hidden because it contains spoiler information about the solution
same problem there. I get manage the mathematic solution who doesn't need to calcul the factorial and who have only one loop to get a sum requested for the solution. All tests are green, but attempt said server time ran out... i can not imagine what can be different to pass the server time obstruction. On my computer, there is no significative delay as long as it is very simple.
In fact, i got an answer show me that my solution was too slow... i do simplification for remove the sum part, but again... too slow.
This comment is hidden because it contains spoiler information about the solution
You absolutly no need to calcul a factorial for get the trailing zero in the result of a factorial. It is just a mathematic problem where only sum and power and division is required.
it is just wrong... why a wrong answer could be a good practice ?