Answer the question
In order to leave comments, you need to log in
How to find squares in a square?
There are coordinates of points and you need to find all the squares
Answer the question
In order to leave comments, you need to log in
Alternatively, you can solve the problem: find all squares with the upper left corner at the point (x, y) and side k.
For k = 1, it is trivial to calculate for all points.
For k = n, we answer based on previous results for k = n -1.
UPD: This is from the assumption that the filled squares are interesting.
hasRect[x][y] = hasRect[x][y] && hasRect[x + 1][y] && hasRect[x][y + 1]&& hasRect[x + 1][y + 1]
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question