Ad
  • Custom User Avatar

    As a solution of this kata? Because truncating and rounding are two different things. If you mean in your code, the error message says this:

    HINT: No function matches the given name and argument types. You might need to add explicit type casts.

    So you could try using some casting, but it won't work. You better try another function.

  • Custom User Avatar

    It can't be removed, but you also do not need to remove it. Just leave it as it is, it does not hurt anything.

  • Custom User Avatar

    You used .strip, there's "str" there.

  • Custom User Avatar

    let me know if you need help to investigate it

  • Custom User Avatar

    Edit: python tests are ok, looks like your solution is bad:

    ' acdeghlmnqrvyz' should equal 'acdeghlmnqrvyz'
    

    You return empty spaces, this is the problem, and the empty space disappears when you sort your result

  • Custom User Avatar

    please, could you create the issue and leave your solution there? it must be rare case because 2000+ solutions were ok

  • Custom User Avatar

    ...because this task is not about the sorting so I don't care about this part.

  • Custom User Avatar

    hi:) it means you can return an unsorted result and I will sort it for you and I will compare with the correct result(also sorted)

  • Custom User Avatar
  • Custom User Avatar

    Hi. This is a problem due to the design of the tests. You get this message when you return "It is not possible" and the tests expect an expression to evaluate. There is already an issue about this for Python (this is using the new framework and use clean tests, actually). You have to handle it (remember: when you get this error, you are returning that it is not possible while it is) or pass to another kata.

  • Custom User Avatar

    I'm just saying that my function, receiving test data at the input, gives the correct answer.

    clearly not if it fails tests.

    Are you suggesting I dig into your test? ;)

    if a test case is found that your code fails, then yes you should look at that test case.

    your test

    it's not mine any more than it is yours

    "There is/are 1 solution(s) in this list of words: <module 'codewars_test' from '/workspace/default/.venv/lib/python3.11/site-packages/codewars_test/init.py'>"

    yeah that's gibberish. but you can still look at the test case, as mentioned, by printing, which is quite common on codewars. and you won't get that test output any more (you'll need to reset to get the new basic tests or just use the test/submit button instead)

    But it seemed to me that you yourself would be interested in what is wrong with the test. ;)

    you haven't shown anything to be wrong

  • Custom User Avatar

    show, don't tell. provide actionable information.

    (and in particular, because comments worded this way (saying there's a problem but not demonstrating it in any way) indicate that you haven't understood what happened and as such you don't know that the problem is with the kata rather than with your own code, and if someone that doesn't know what happened wrote code, then it's probably that code which is wrong. it might not be that way, but if it is that way then you're likely to express it like you did, and therefore when someone expresses it this way then it usually is this way)

    this kata for python wasn't providing much more feedback than "wrong", but I mean you could still print and you're 2 kyu so you know that. just the same, I approved an update that was pending with better feedback which will show you input/output

  • Custom User Avatar

    You're mutating the input thus creating a wrong expected value for the original input values. I've changed the tests so the expected value is calculated before and that won't be happening anymore, but keep that in mind next time something like that happens to you. To avoid it, just don't mutate the input next time.

  • Custom User Avatar

    I agree, there is a mistery in the definition of the shift.

    Someone below pointed the fact that in case of a shift differet of 0 or from the halft of the lenght of the arrays , the shift is not simply shift x '0' at the beginning of the second array, , 2 x shift x '0' at the beginning of the 3rd array and so on .

    Here with a length of the arrays of 6, a shift of 3 ( identical to the test samples ) and 4 arrays , the real shift seems to be 6 and there are 9 ending '0' . So a total length of 6*4+9 = 33 that nothing in the initial description can explain.

  • Custom User Avatar

    you are wrong, you don't have to choose always the bigger number posible, you can get a better path sometimes going through the worst option.

  • Loading more items...