Ad
  • Custom User Avatar

    You can't use the word group, even in comments.

  • Custom User Avatar

    It returns False in those cases, just like the description says to.

  • Custom User Avatar

    This is not an issue with the kata, this is an issue with your code. The input that you're failing on is not 123 , look more closely.

  • Custom User Avatar

    Yes, if you notice, all the punctuation in the tests is currently separated by spaces. Even in the description, the example shows the punctuation separated by a space. This is likely intentional to make the kata simpler. The solutions were all built with this in mind, so of course they won't work properly if you change the nature of the inputs. Adding tests as you've suggested would invalidate the vast majority of the 165k+ solutions, and isn't really worth doing.

  • Custom User Avatar

    It crashes on the third sample test where the input is an empty string.

  • Custom User Avatar

    No, your code just doesn't work. Look at the word aren't

  • Custom User Avatar

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

  • Custom User Avatar

    That method is not available in numpy version 1.24, which is the version that codewars currently uses. You could request a module update on github, but that will likely take a long time. Realistically, you just need to find another way to solve the kata. Your solution can work with minimal changes if you examine the documentation that you linked more closely.

  • Custom User Avatar

    Yes, the reference solution for java incorrectly checks for exactly 2 sets of 2 cubes that add up to n instead of at least 2 sets of 2 cubes.

  • Custom User Avatar

    Why would you treat double spaces any differently than single spaces? I don't think this is reason enough to raise an issue.

  • Custom User Avatar

    dani is correct, you need to be able to express the number as two different sets of two cubes in order to return true.

  • Custom User Avatar

    The description says to check if the number can be written as the sum of two cubes in two different ways, there's nothing to suggest that it can only be written in two ways.

  • Custom User Avatar

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

  • Custom User Avatar

    It's your solution. Your solution fails on inputs where encoded text could also be a binary number, and you can see it in the output of the test that you included. Expected: 'wrqjvi, 0, dubb, 13, j... Your solution produced: instead got: 'wrqjvi, 0, dubb, 13, 6..., notice that you have two numbers in a row? Because j is 110, which can also be interpreted as a binary number. Your solution will fail on similar tests, you can add this to the sample tests: Test.assertEquals(decode('1011011011019800110110'), "aaa, 54"); to see it failing in real time.

    You just got lucky when you resubmitted your solution and the tests didn't generate a case like this one. The random tests might need to be hardened to make sure to include a "tricky" case like this, but as it is, there is nothing going "wrong" with the tests.

  • Custom User Avatar

    You can print the list of installed modules by switching the python version to one before 3.11 and calling help('modules') inside of a kata

  • Loading more items...