You are given a 2D binary grid representing a map of land, where 1 represents farmland and 0 represents forested land. Farmland groups are rectangular, non-overlapping blocks of 1s.
Find the coordinates of all groups of farmland. For each group, you need to return its top-left coordinate (r1, c1) and its bottom-right coordinate (r2, c2) as [r1, c1, r2, c2].
Visualizer will appear here