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'm guessing, because each encoding swaps one character with another distinct character in a loop that includes all characters, by encoding 66 times you cycle through all characters in the loop and return to the original character. Doing it 65 times stops one short of that and gives the same result as -1 time.
why does this work?
just time out
as i said, did everythinig i could to shortened it.
i believe i wasnt expected to do super advanced math calculation as a basic kata and as a programming challange and not a math question.
for finding the next prime i only checked previous primes and not all numbers until the root
i used a generator function to calculate only whats necessary
Are you getting some sort of error or just time out?
It is a question, not an issue of the kata but a problem of your code. You could read https://github.com/codewars/codewars.com/wiki/Troubleshooting-your-solution.
i tried to make it faster as much as i could but its still taking over 12 secs
created a list of primes and every new num checked on the list rather than range, checking only odd numbers
what can i do?
(python)