Ad
  • Custom User Avatar

    While my approach passes the standard tests it fails often in the random tests. The test suite claims that for example for the difference of
    A-B = [9, 12, 1, 1, 77, 34, 1, 1, 0, 73, 20, 25, 60, 42, 28, 24, 10, 11, 30, 35, 36, 0, 33, 18, 51, 26, 0, 51, 13, 25, 13, 10, 49, 8, 5, 25, 64, 12, 42, 1, 13, 57, 43, 0, 1, 39, 12, 10, 18, 1, 27, 1, 31, 7, 71, 61, 27, 38, 15, 42, 1, 11] the optimal solution is 21 thieves for k=77.

    As far as I can see from solving this by hand and with a binary division and greedy approach it can be achieved with 20 thieves without breaking the rules. This also corresponds to the heuristic for the lower bound of the sum(differences)/k which is 19.5. Am I missing something or are the random tests only sometimes using the optimal solution as K01egA hinted at?

  • Custom User Avatar

    Yes, that was not clearly specifified and could only be derived from the example. To make sense as an outlier-rejection algorithm the order of evaluation must not matter. We therefore only consider the original data as a whole.

  • Custom User Avatar

    Oops, there was an off-by-one error that is fixed now. So the 3 is cut now correctly.
    Thanks for raising this issue!

  • Custom User Avatar

    Thank you for the feedback on the beta of this Kata! The initical code was indeed necessary as part of the specification, so I changed the description now that it can stand alone.

  • Custom User Avatar

    I find the description still confusing. If I naively think of paste errors why can the output still contain "BBBB!BBBB!"?

  • Custom User Avatar

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

  • Custom User Avatar

    Ok, fixed that as well. I somehow interpreted this as number of rolls per side, not total for all sides of the die.

  • Custom User Avatar

    I have added a show method to the test suite. The behavior should now be closer to the Java version.

  • Custom User Avatar

    This fun Kata deserves more translations. I put together a Python translation and would be happy about comments and feedback.

  • Custom User Avatar

    For this nice Kata I added a Python translation and the corresponding tests. I would be happy about any comments, improvements, etc.

  • Custom User Avatar

    I thought of this as well and found that dice can have two faces (https://www.scienceabc.com/eyeopeners/many-faces-can-die.html) but that depends if you follow their argument.

    In any case, thanks for the feedback, I will work on some translations of the other Katas now. For the next one I will aim to be much more specific about the input and output parameters.

  • Custom User Avatar

    Especially the first one is quite similar. I must admit before authoring this Kata I did not really search for similar ones and then only in Python.

    My focus was on the aspect of the transformation from the input data into a vertical histogram, so the third one is quite different. The best way forward is probably to add a translation to the first two. I don't think I can make this one unique without simply making it more complicated/specific.

    Thanks again for the feedback, this is my first Kata ever.

  • Custom User Avatar

    Thank you for the suggestion! I added a test case so that it is easier to figure the rules for white-space. Now the user can see from both the example output in the description and the test case the width of the columns.