Number of isolated squares on a grid
Hi everybody !
I have an issue with a matrix, the terms of which are only 1 or 0. I'd like to count the number of isolated squares in my matrix (if one square has no direct neighbour, in any of North, South, West or East direction). For example : 00100 01110 00001 This matrix has 2 groups of isolated squares. I already looked for algorithms but couldn't find... Thanks for your help !
Comment
Your answer
Follow this Question
Related Questions
Approach for filling 6x6 matrix with shapes 2 Answers
3d grid/matrix inside a mesh 1 Answer
Destroying an object in a matrix 0 Answers
Move object to grid 1 Answer