Find Farmland Groups In Binary Matrix Land
Find all groups of farmland in a binary matrix: [[1,0,0],[0,1,1],[0,1,1]]. Return top left and bottom right corner coordinates for each group. Example output: [[0,0,0,0],[1,1,2,2]]
1992. Find All Groups of Farmland Medium You are given a 0-indexed m x n binary matrix land where a 0 represents a hectare of forested land and a 1 represents a hectare of farmland. To keep the land organized, there are designated rectangular areas of hectares that consist entirely of farmland. These rectangular areas are called groups. No two groups are adjacent, meaning farmland in one group is not four-directionally adjacent to another farmland in a different group. land can be represented by a coordinate system where the top left corner of land is (0, 0) and the bottom right corner of land...
