Color area of a closed shape formed by ones in binary matrix

Viewed 38

I am trying to solve following problem: Suppose we have a binary matrix for example:

000100
001010
010001
001010
000100

So,how can I fill the area within the closed shape with ones? And first, how can I determine that the shape is closed?

0 Answers
Related