find all rectangular areas with certain properties in a matrix
问题 given an n*m matrix with the possible values of 1, 2 and null: . . . . . 1 . . . 1 . . . . . 1 . . . 2 . . . . . . . . 2 . . . 1 . . . . . 1 . . . . . . . . . . . 1 . . 2 . . 2 . . . . . . 1 I am looking for all blocks B (containing all values between (x0,y0) and (x1,y1)) that: contain at least one '1' contain no '2' are not a subset of a another block with the above properties Example: The red, green and blue area all contain an '1', no '2', and are not part of a larger area. There are of