Ad
  • Default User Avatar

    Fixed.

  • Custom User Avatar

    In Python I used "strng" instead of "str" because function "str" exists. Same thing in Clojure.

  • Default User Avatar

    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.

  • Default User Avatar

    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

  • Default User Avatar

    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.

  • Default User Avatar

    A clever and impressive interpretation of the problem!

    All the plaudits to you!!!!

  • Custom User Avatar

    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.

  • Default User Avatar

    @dykchui

    if you're doing text translations like this on a pseudo-phonetic level you should assume a preprocessor that deals with orthographic tokenization.

  • Default User Avatar

    Why would you ever want to do this?
    I feel like this encourages bad approaches to problem solving.

  • Default User Avatar

    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.

  • Custom User Avatar

    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.

  • Default User Avatar

    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

  • Custom User Avatar

    Your code might be not fast enough.

  • Default User Avatar

    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

    time.time();p = findPrimes(10000141); time.time()
    1452826113.21
    1452826113.602

    This same thing goes over the 6s limit on codewars.

  • Default User Avatar

    What do you do if there are more than 2 spaces between words?