Ad
  • Custom User Avatar

    Al least since 2016, description has this line:

    The input string can be assumed to contain only alphanumeric characters, including digits, uppercase and lowercase alphabets.

    I think he translated that to a regular expression in his post.

  • Default User Avatar

    The other issue says:

    Description says that the input will only contain /[a-zA-Z0-9]/

    I don't remember if it was true, but it doesn't say that now, so it's not clear which language(s) is/are supposed to be fixed.

  • Custom User Avatar
  • Custom User Avatar

    Not a kata issue.

  • Default User Avatar

    thanks a lot, it works now. Much appreciated.

  • Default User Avatar

    this was not in any way against you ^^ On Codewars, specifications about what kind of input the user will receive must be unambiguous, and in most cases should not be changed after a kata has been approved, to provide a consistent experience. There are many other katas about input validation.

  • Custom User Avatar

    This was a hypothetical, real-world question. I wrote this bring to light the fact that the test cases don't catch this and is an easily missed caveat. I have come across bugs like this in my work.

    Two years ago tho, yikes. Basically prehistory.

  • Default User Avatar

    The description states:

    The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits.

  • Default User Avatar

    The description states:

    The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits.

  • Default User Avatar

    you are using global variables to store the state of your function; this is bad practice. In particular, you forgot to reinitialize str between function calls. You should move str to function scope.

  • Default User Avatar

    my bad regarding the tag.

    Thanks, I changed the function to nul-terminate but it still does not work. Again the return value that I get in my IDE is the correct one but it's not the same in CodeWars environment...

  • Default User Avatar

    please, use the question tag to ask for help, an issue is a bug in the kata.

    your strLower() function does not nul-terminate s, this is undefined behavior and it makes your program unpredictable

  • Default User Avatar

    C: I can't pass the random tests.

    I get this error message. The submitted value is not the expected one.

    Example:
    text = "BDkCifBUrf6j8idgqpjV"
    Submitted: 2 expected: 5

    I added a printf to show me the return value from my code and it is indeed 2 in the CodeWars IDE.
    However it's 5 in my own IDE.

    Anyone got this issue? Or maybe I don't understand something.

  • Custom User Avatar
    1. ...And?
    2. spoiler flag, thx.
  • Default User Avatar

    Hi @luckyvictor and welcome to Codewars! It seems this is your first kata on the site: on Codewars you must return your answer rather than print it - so looking at your currrent solution, try replacing:

    print(count) with return count

    For future reference, as you get started with the site, this page is a useful resource also: Troubleshooting guide

    Good luck on your Codewars journey!

  • Loading more items...