Lets say you have a matrix like the following:
var map =
[
[0,0,0,0,0,0],
[0,1,1,1,1,0],
[0,1,0,0,1,0],
[0,1,1,1,1,0],
[0,0,0,0,0,0],
[0,0,0,0,0,0],
];
What methods could be used to determine that there is a square of 1
s inside of the matrix of 0
s? What about multiple squares/rectangles offset to each other (Not overlapping, just potentially side by side)?
I'm sure that methods have already been made for such things, and I would love to learn about them.