Ad
  • Custom User Avatar

    Sure, I see and I think i know where confusion comes from. When you try the task there is an extra paragraph saying:

    Pixels are 'adjacent' if their coordinants differ by no more than 1 on the X and/or Y axis.
    

    I interpreted and there as a sum |x1 - x2| + |y1 - y2| <= 1. So if one pixel has x and y as coordinates, diagonal pixel would have x(+/-)1 and y(+/-)1 coordinates.

  • Custom User Avatar

    Tests are broken, in JS

        var image = [
          [0,0,0,0,0,0,0,0,0,0],
          [0,0,1,1,0,0,0,0,0,0],
          [0,0,1,1,0,0,0,0,0,0],
          [0,0,0,0,0,0,0,0,1,0],
          [0,0,0,0,0,1,1,1,0,0],
          [0,0,0,0,0,0,0,0,0,0],
        ];
    

    expects 2 while there are 3 islands

  • Custom User Avatar

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

  • Custom User Avatar