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.
haha, I forgot to simplify it
Without using re, this is probably the most efficient implementation
Very clever, clearly understand the number math of power of 3
An complicated implementation without the understanding of the underline number math
What about the case: word1 = 'ab1cd', word2 = 'abcd'? I think this should be True, but your solution would return False.
I see. Thanks!
This may not be a correct implementation. For example: A = [3, 2, 3, 4, 5], a = 3, b = 4.
Using your function would return False, because A.index(3) = 0, A.index(4) = 3
Probably the most elegant implementation of this problem.
Sorry, this is really a stupid implementation. Early in the morning, my brain is not working
Lots of errors in your test cases!
13 is not a Mersenne prime as 14 is not a power of 2
Neither are 17, 19, ...
I think I have the correct implementation, please use it to generate real test cases.
I think this is probably the most efficient implementation
My factors() could be optimized by add d and N//d at the same time when N%d==0 and do it only to int(N**0.5)+1
Maybe I'm not smart enough, I don't understand how one can do this with just one pass of the string.
This comment is hidden because it contains spoiler information about the solution
Since the initital 5 test cases has a range 2 to 1,000,000, which would generate all legit numbers for all other testcases. So this is probably the most efficient implementation.
Loading more items...