Ad
  • Custom User Avatar

    Your code is wrong because you rely on approximate values to give exact answers. If your code does produce different results elsewhere then you might be on a different architechture (ARM?) and it would still be wrong even if it should happen to incidentally give correct answers, if that's even the case.

  • Custom User Avatar

    Something is weird in Python. I get correct test results locally in VSCode with Python 3.12.7. Here with Python 3.11 the True cases are returned False by the same code. Is the is_integer() function evaluated differently here? Or was there a bug with math.cbrt() in 3.11? Or is it something else? What is going on?

  • Custom User Avatar

    preceded and followed by the same number of non-zero elements

    That's about the non-zero elements, and you can see that in the sample test.

  • Custom User Avatar

    The description is not clear enough. The rule "preceded and followed by the same number of non-zero elements" -> does "same" refer to the zeros? Or to the non-zero groups at the beginning and end?

  • Custom User Avatar

    I don't get it. What do you want us to sum up? Please show an example with the result.

  • Custom User Avatar

    Many katas are this way, they only require pretty much some further mathematical research.

  • Custom User Avatar

    Solved it, but it's still dumb. You either see/find the magic formula or you're screwed. No programming or algorithm challenge here.

  • Custom User Avatar

    First, there is a typo in the desription. "All numbers in will be positive integers.". I guess the word "arr" is missing in there.
    Second, the description create unnecessary confusion. At the beginning a range of numbers are compared to each other. But afterwards a list of number shall only be compared to one number (=n).

  • Custom User Avatar

    This kata is "Google the formula" instead of "Show your programming skill"...

  • Custom User Avatar

    Several results make no sense. Like "act(0, 6, 0, 1)": How can you throw zero dices one time? That is physically impossible. You can only reach zero points by not throwing the dices at all, no matter how many you have.
    Or "act(1, 6, 0, 1)": How can you throw one dice with side values of 1-6 and reach zero points? The minimum you can reach with one throw is 1.
    Or "act(0, 6, 1, 0)": You have no dice, but you reach a score of 1 by throwing them zero times? How is that supposed to work?
    Or "act(1, 6, 7, 0)": You can score a maximum of 6 points with a throw, but with zero throws you can score 7 points...?
    My opinion: A target of zero can only be achived with zero throws, no matter how many dices and sides you have. If the target is >0, then there should be >0 dices, otherweise return -1 or "Error". A target larger than the maximum points you can achieve should either be removed or also lead to -1 or "Error".

  • Custom User Avatar

    The desription is not correct. The description says "below n" and "smaller than n", but the tests includes n.
    For n=157 the expected result is [21, 157, 173]

  • Custom User Avatar

    The instructions should be improved. It should be possible to solve the Kata without guessing and trying.

  • Custom User Avatar

    That broke all solutions...

  • Custom User Avatar

    This might be worth raising as an issue with the Python version, since other languages don't seem to have the requirement at all.

  • Custom User Avatar

    The description didn't say that the output needs to be sorted.

  • Loading more items...