package leetcode;

import java.util.Arrays;

/**
 * https://leetcode.com/problems/find-all-groups-of-farmland/
 */
public class Problem1992 {
    public int[][] findFarmland(int[][] land) {
        // TODO
        return null;
    }

    private static void print(int[][] arr) {
        for (int[] a : arr) {
            System.out.println(Arrays.toString(a));
        }
    }

    public static void main(String[] args) {
        Problem1992 prob = new Problem1992();
        print(prob.findFarmland(new int[][]{
            {1,0,0},{0,1,1},{0,1,1}
        })); // [[0,0,0,0],[1,1,2,2]]
        print(prob.findFarmland(new int[][]{
            {1,1},{1,1}
        })); // [[0,0,1,1]]
        print(prob.findFarmland(new int[][]{
            {0}
        })); // []
    }
}

@@ -715,32 +715,129 @@
 nd(new int%5B%5D%5B%5D%7B%0A
+            %7B1,1%7D,%7B0,0%7D%0A        %7D)); // %5B%5B0,0,0,1%5D%5D%0A        print(prob.findFarmland(new int%5B%5D%5B%5D%7B%0A
             %7B0%7D%0A

Update problem 1992