Ad
  • Custom User Avatar

    "foobar00" turns into "foobar01" because the end result after the string was incremented was 2, which did not take up both digits. If it was "foobar09", then it would turn into "foobar10", because the result now takes up both zeros which were in the input. In the case of "foobar099", 99 turns into 100, meaning it now takes up 3 digits. In "foobar099", there are 3 numbers at the end, so you would not include the extra 0 after incrementation.

  • Custom User Avatar

    Yes, and no.

    Because of some specifics (which are partially explained in docs), usually kata have two kinds of tests which are run when you hit the ATTEMPT button: so-called "fixed tests", and so-called "random tests". Fixed tests are the same every time. Random tests are generated separately for every test run. Ideally, when a solution has some bug, there should be always at least one fixed test case which fails every time on wvery run of the solution, accompanied by at least a few failing random tests, which can be different every time. This is an ideal situation. But it happens quite often that coverage of the fixed test is either neglected by authors, or difficult to ensure for some types of problems. In such case, it can happen that your faulty solution will pass all fixed tests, but can fail some randomly generated tests. As a result, you will see no pattern between failed test runs.

    This is one possible explanation of the behavior you observe. Other reasons are also possible, but we cannot say anything for sure without seeing your code.

  • Custom User Avatar

    Yes, this is the whole meaning of "random tests".

  • Custom User Avatar

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

  • Custom User Avatar

    NOTE: There will also be lists tested of lengths upwards of 10,000,000 elements. Be sure your code doesn't time out.

    Your code is too slow. See https://docs.codewars.com/training/troubleshooting#timeout.

    Not a kata issue. See https://docs.codewars.com/training/troubleshooting#post-discourse.

  • Custom User Avatar

    Oh?
    What possible combinations are missing?

  • Custom User Avatar

    Use spoiler flag next time please.

  • Custom User Avatar

    I've tried the code above in 3 different Python versions and it worked fine! Make sure your initial code has the correct identation and correct spelling specifically for the name of the Exception.