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.
Yeah I don't know what I was doing either...
That is an O(n**2) solution. How is this the best one?
Very clever solution!
Why are the test constraints so large?
Shows that you have inefficient algorithm.
This comment is hidden because it contains spoiler information about the solution
Unfortunate, this solution always times out for me..
Most genius.
Very nice.
I know that this is 6 years late, but your submission is correct and passes all the test cases. The reason it was failing was because in line 7 you have prime_factors(n/i). Since for loops require integers, if you change this to prime_factors(n//i) it passes everything.
You have a constraint on x, but no where in the description do you mention what x is. Is it referring to N?
Wait so when it says an infinite amount of primes, does that mean that our prime generator needs to keep running or does it need to stop when a certain threshold has been reached?
You're right, this is the advanced version...
Pre-calculation on codewars is very different from other sites as it only needs to call the function, so you can create the prime string beforehand.
Man if this wasn't using integer division it would have been a one liner...
Loading more items...