Ad
  • Default User Avatar

    I've just made a translation to Java of this kata. Please take a look at it and approve it if you consider it correct:
    https://www.codewars.com/kumite/664fa3ac97f86799e35207bb?sel=664fa3ac97f86799e35207bb

  • Default User Avatar

    I've incorporated your suggestion to the kata description.

  • Custom User Avatar

    What's the minimum amount of rectangles required to fill the entire matrix? Each rectangle consists of only one color.

  • Default User Avatar

    Any suggestion for a less confusing single word for "same-color adjacent rectangular regions"?

  • Custom User Avatar

    Yes, "overlapping" rectangles is a different problem.

  • Default User Avatar

    I marked them as containing spoilers because they contain hints (sometimes subtle ones, sometimes even quite specific) about how someone could resolve the kata. Sorry about that.
    Maybe I can try to make more concise comments in which I only answer the question without details or possible hints.

    Answering your question without spoilers:

    No, the shape of the found regions does not alter how many you should find, so it doesn't matter. The count is the same.

    With respect to overlapping regions, you should think how would you decompose that into rectangular regions, even if they are adjacent and of the same color. So, answering your question, that would be decomposed into 3 regions.

    Maybe "overlapping" is not the best name. I wanted to convey a single word for same-color adjacent regions.

  • Custom User Avatar

    I don't understand why you added spoilers to all these comments. All I'm asking is a clarification of the specification.

  • Default User Avatar

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

  • Default User Avatar

    Sample tests are checking for the requirements of the kata (empty input, simple data, etc).
    I have gone through the tests to see if they are representative and I think they are: They check for empty pictures (size 0), simple pictures (one region), pictures with overlapping regions, pictures with non-overlapping regions in different orientations, and other simple pictures.

    What comes next in the full test suite is just bigger pictures with bigger regions, but more or less the same as these simple tests.

    Is there some specific test that is troubling you? I can see if I can devise an example test for a confusing part of later tests if it helps.
    Anyway, thanks for the feedback!

  • Default User Avatar

    I've corrected the ordering both for the sample tests and for the full test suite, including not only the order of individual tests but also the order of groups of tests. I hope that reduces confusion.

  • Custom User Avatar

    another thing about overlaps (let's only consider 1's):

    1 1 1 .
    1 1 1 .
    1 1 1 1
    . 1 1 1
    . 1 1 1
    

    can we see 2 overlapping regions here, or are there 3 regions?

  • Custom User Avatar

    for

     1  1  1  0
     1  1  2  2
     3  3  1  1
    

    why do you claim

     A  A  B  .
     A  A  .  .
     .  .  .  .
    

    instead of

     A  A  A  .
     B  B  .  .
     .  .  .  .
    

    Does it even matter what the exact regions are?

  • Custom User Avatar

    (sample) Tests are not ordered in the same way as written in code. This is confusing and gives bad user experience.

  • Custom User Avatar

    I pass all sample tests, but not fixed or random tests. It seems sample tests are not entirely representitive of tests to come ..

  • Custom User Avatar
  • Loading more items...