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.
Fixed.
In Python I used "strng" instead of "str" because function "str" exists. Same thing in Clojure.
In python the instructions refer to the first argument of revrot as "str", but in the code it is "strng". This should be changed so the two match.
Naming convention of 'string' is very bad form in python. If you want to indicate the type of a python variable please use reverse hungarian notation (str_....). If the type of a variable is very important you might not want to be using python
It is still very unclear. Your use of the word "and" leaves multiple syntactically and semantically valid interpretations. Your test cases seem to support BOTH interpretations.
So it could be Every (encoding and decoding) is independent, which passwordpasswordpassword -> aaaaaaaapasswordaaaaaaaa supports. If you didn't 'remember' the key from the encode, passwordpasswordpassword should be aaaaaaaaaaaaaaaaaaaaaaaa
OR it could be Every encoding and (every) decoding is independent, which the "it's a shift cipher!" test case supports
Does that mean that a pair of calls (encode, decode) use the same CONSTRUCTED key and then it's reset when the second function is called?
What about encode encode?
The encode/decode functions aren't hard to write here, but the actual expectation of the problem is poorly defined.
A clever and impressive interpretation of the problem!
All the plaudits to you!!!!
You may not want to do this specifically, but I think the principle is interesting. I'm showing that it's possible to do these kinds of things with a bit of lateral thinking and just regex.
@dykchui
if you're doing text translations like this on a pseudo-phonetic level you should assume a preprocessor that deals with orthographic tokenization.
Why would you ever want to do this?
I feel like this encourages bad approaches to problem solving.
you were rude. I was rude back. Get over it.
I'm aware there's something clever to do that doesn't require finding all primes.
again, not the question.
My comment is certainly useless and unhelpful but I am not a member of the Codewars' staff... I don't know more than you about the CW specs.
No need to be rude with me.
All I can say is that about 60 guys passed the kata in Python and that maybe your sieve is metal wrought but there is no need of it to pass the kata. Much sorry, sometimes CW is very busy and slow but it is not of my responsibility.
that is a useless and unhelpful comment. My question is why is the such a difference in benchmarking between CW and local, ie what are the CW specs. The difference I see is extreme.
As to fast enough, my algo, the sieve, is the quickest at least to 32bit and is done on numpy, so I'm very close to the metal. I'm not convinced
Your code might be not fast enough.
What kind of system is this running for Python?
I have a seive implementation to get primes for this problem. My computer is a pretty wimpy Lenovo, I run locally
This same thing goes over the 6s limit on codewars.
What do you do if there are more than 2 spaces between words?