Ad
  • Custom User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

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

  • Default 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.

  • Default User Avatar

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