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

    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?