Ad
  • Custom User Avatar

    More than 2,000 people have passed this; are you sure you're not modifying the input in some way?

  • Custom User Avatar

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

  • Custom User Avatar

    You have the correct output for the example you gave. Which programming language are you using?

  • Custom User Avatar

    complain to the original author, then, not me. ;)

  • Custom User Avatar

    Errr... I didn't think about that this way but, effectively, you could consider the example with a torus approach. But that's not the case, actually: in fact, if the starting point isn't surrounded by 1 on all sides (without wrapping on the other side of the grid), you have to considere the grid "invalid" and fill it with ones. I'll update the description so that it's clearer.

  • Custom User Avatar

    the starting point isn't surrounded on ALL sides, that's why. ;)