Ad
  • Custom User Avatar

    I really appreciate your explanation, this was the most difficult part of this kata, thanks!

  • Default User Avatar

    ffs, thank you for that! instructions needs to be reworked!

  • Default User Avatar

    Thank you so much for your explanation. I was doing Total Set instead of comparison and getting errors.

  • Default User Avatar

    Thank you very much. It was very useful!

  • Default User Avatar

    thanx for explaining. This kata description is some sort of kata itself

  • Custom User Avatar

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

  • Custom User Avatar

    It's a height map. Think of the numbers as heights of square columns stacked next to each other. Water spreads across equally high columns and trickles down into onto lower columns.
    Water flows in cardinal directions only, not diagonally. Hence the bottom right corner is not a leak.
    6*4: There are 4 colums of height 0 surrounded on all sides by columns of height 6; 6-0 = 6 -> 4*6
    4*8: Ther eare 4 columns of height 0 surrounded on all sides by columns of height 8; 8-0 = 8 -> 4*8.

    You can think of it like this: if it rained evenly all over the heightmap, where would water fill and stay?

  • Custom User Avatar

    I did not understand this kata. If you look at the example in the instructions, the bottom right element is 0. Hence, when filled, should the last column not contribute 63 and not 64?

    Also, what does 4*8 mean? Does each column of 8's (i.e. 4 8's) contribute 8?

    Does each column of 4 6's contribute 6? If so, how much would a column of 2 6's (the top two elements being 6 and the bottom 2 elements being 0) contribute?

    If there is a column, which reads, from top to bottom:
    8
    6
    4
    2
    Is this possible? If so, how much does it contribute?

    @thquinn