Ad
  • Custom User Avatar

    lens=len(s) and replace it -- this will improve it quite a bit.

  • Custom User Avatar

    It's unnecessarily complciated, inefficient in recurrsion, O(n**2), and memory. For example, if you try this,
    longest_palindrome("a"*100000+"b"*100000)
    it wouldn't run.
    But if you try my solution (and many others similar linear solution), it'll come out in a fraction of a second.

  • Custom User Avatar

    I believe this algorithm has close to optimal performance in terms of speed and memory.

  • Custom User Avatar

    This kata should be revised and explained clearly. Otherwise, a lot of people will waste a lot of time.

  • Custom User Avatar

    This test is so bad. It doesn't say clearly how to deal with punctuation, and the "correct" solution ignore all words attached with any punctuation, and it just doesn't make sense. Don't waste a lot of time here because finally the "correct" answers are wrong.

    Go try to pig_it the following string: "Hi~ Guys@Codewars:\nThat's a so-called 'pig-latin way', isn't it?!"

    If you run the "correct" code, you will get this result. It just doesn't make sense.

    Hi~ Guys@Codewars: That's aay so-called 'pig-latin way', isn't it?!

  • Custom User Avatar

    This test is so bad. It doesn't say clearly how to deal with punctuation.
    I couldn't get to the right answer until I used very naive method to split. Any word that's attached to a punctuation will not be translated.
    Go try to pig_it the following string. "Hi~ Guys@Codewars:\nThat's a so-called 'pig-latin way', isn't it?!"

    If you run the "correct" code, you will get this result. It just doesn't make sense.

    Hi~ Guys@Codewars: That's aay so-called 'pig-latin way', isn't it?!

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution