Ad
  • Custom User Avatar

    And what does your solution return in your IDE for incrementString("foobar000")?

  • Custom User Avatar

    testing's ok, the problem is that it fails on the examples on codewars but when i test the same examples in ide it works just fine

  • Custom User Avatar

    If your code fails on Codewars but seems to work in your IDE, it usually does not mean that the code is correct. It means that you are testing it in the IDE incorrectly.

  • Custom User Avatar

    count the zeroes in both strings.

  • Custom User Avatar

    Try to run it in a normal compiler in an IDE, it will and it does run correctly - so the code is in fact correct.

  • Custom User Avatar
    • please do not use the issue tag to ask for help, ask a question instead
    • i ran the sample tests against your code and saw this:
    Incorrect answer for input: "foobar000"
    Expected: equal to          "foobar001"
    Actual:                     "foobar0001"
    
  • Custom User Avatar

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

  • Custom User Avatar

    You should not convert the stringified result derived from the regex group to integer, because it will truncate leading zeros, giving the wrong results. Not a kata issue nonetheless.

  • Custom User Avatar

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

  • Custom User Avatar
  • Custom User Avatar

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

  • Custom User Avatar

    Your solution has a bug, it crashes for inputs like "foobar999". It is not a kata issue.

  • Custom User Avatar

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

  • Custom User Avatar

    Had my Rust solution succeed on first submission and then had on a second one choke on the random test input 999999. This test might catch a lot of faulty solutions and should probably be added to the fixed tests.

  • Custom User Avatar

    You need to add a digit only when it's needed, like from 9 to 10 or 99 to 100. In the cases you mentioned, there is no need to add one, only keep the same amount of digits. Not a kata issue.

    Attention: If the number has leading zeros the amount of digits should be considered.

  • Loading more items...