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.
I agree the only positive side to list comprehension is just how consise it is and the speed of execution (it runs faster than traditional nested loops).
but I'm replying to the...soluion...itself? So i dont think spoiler flag is nessesary, unless there is a feature never heard about on code wars where we can look at solutions first
10/10 for dark magic sorcery, 1/10 for readability (and making me go blind). I don't allow this kind of sorcery in my projects btw. Now...I shall be on my way. Seriously though, I'm curious about the running time of this solution
Comments?
this is the best practice, it's a closed form solution. Mathematics studies paid off.
This comment is hidden because it contains spoiler information about the solution
I tried to go technical by determining if the summation converged or not. Turned out it didnt. The summation sequence can be simplified, such that
it translates more gracefully to code. Math is very important.
at least your able to SEEE the test file in NASA (it makes sense that a programmer would have too), on here you cant
These tests are annoying, turns out they want a really general solution that covers every possible case and
avoids all the errors as much as possible