Ad
  • Custom User Avatar

    "works" in this context means that you your code didn't fail because you did not test the case that fails

    if you're looking at the string the keyerror mentions, that's what you gave to a dict for lookup. you should be looking at what the input was instead.

  • Custom User Avatar

    "My solution does not work" is not a valid kata issue.

    We cannot tell where your solution is wrong without knowing your solution :)

  • Custom User Avatar

    My Python solution works in VSC, but not in CodeWars. In CodeWars, I am seeing two tests fail, for "thousand" and "eight thousand one". Both come up with KeyError logs on the site, but work as expected in my VSC editor. Am I doing something wrong?

    P.S. I am of the opinion that my solution is rather inefficient but it was my first attempt at solving the issue, for optimisations to be made afterwards.

  • Custom User Avatar

    Feels like 8 Kyu more than 6 Kyu...

  • Custom User Avatar

    I have the exact same problem with the C language.

    It turned out to be a bug in user's solution.

  • Custom User Avatar

    I saw and fixed the problem. Something so small :'(

    Thanks for the hint 👍

  • Custom User Avatar

    edit: cross-post

  • Custom User Avatar

    I double checked that I initialized the variables and the arrays.

    You need to triple-check ;) I managed to get your solution to work after I initialized all the variables and arrays.

  • Custom User Avatar

    Without seeing your code we cannot tell where it's wrong. You'd have to post your code (remember about code formatting markdown!) so we could check it and tell you what you did wrong. If it's indeed a corrupted memory, you need to fix your code so it does not corrupt memory :)

  • Custom User Avatar

    I have a problem in the C language, I saw other posts with a similar problem (I gave the same reply in one of those posts)

    Everything works well when I copy-paste the code to https://programiz.pro/ide/c

    When I do it in the Kata some tests fail. What's more, sometimes it fails with "twenty gave 21", sometimes it fails with "two hundred and forty-six gave 247".

    One or the other test will fail randomly even if I don't modify a single character in the code. I double checked that I initialized the variables and the arrays.

    I suspect that the memory gets corrupted at some point for some reason (concurrency issue?).

  • Custom User Avatar

    I have the exact same problem with the C language.

    Everything works well when I copy-paste the code to https://programiz.pro/ide/c

    When I do it in the Kata it fails. What's more, sometimes it fails with "twenty gave 21", sometimes it fails with "two hundred and forty-six gave 247".

    One or the other test will fail randomly even if I don't modify a single character in the code. I double checked that I initialized the variables and the arrays.

    It's probably a memory issue where the memory gets corrupted at some point for no apparent reason.
    Maybe OP didn't use pointers or used them in different ways.

  • Custom User Avatar

    more of 8 kyu or 7 kyu if im being generous. im a total beginner, i suck utterly at python and i completed this in 2 minutes

  • Custom User Avatar
  • Custom User Avatar

    In what language?

  • Custom User Avatar

    the code pass the test, but then is not possible to attempt, becouse of the following failure
    assert(left(op(right)) == refsol(x, y))

    the left function was not part of the definition of the problem

    left is not a function; it is a parameter of type Int within the anonymous function (left: Int) => left + right returned by the operation methods. The test should not call a variable like left as if it were a function.

    I think it is a problem of the test

  • Loading more items...