Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
More than 2,000 people have passed this; are you sure you're not modifying the input in some way?
This comment is hidden because it contains spoiler information about the solution
You have the correct output for the example you gave. Which programming language are you using?
complain to the original author, then, not me. ;)
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.the starting point isn't surrounded on ALL sides, that's why. ;)