package leetcode;

/**
 * https://leetcode.com/problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold/
 */
public class Problem1292 {
    public int maxSideLength(int[][] mat, int threshold) {
        // TODO
        return 0;
    }

    public static void main(String[] args) {
        Problem1292 prob = new Problem1292();
        System.out.println(prob.maxSideLength(new int[][]{
            {1,1,3,2,4,3,2},{1,1,3,2,4,3,2},{1,1,3,2,4,3,2}
        }, 4)); // 2
        System.out.println(prob.maxSideLength(new int[][]{
            {2,2,2,2,2},{2,2,2,2,2},{2,2,2,2,2},{2,2,2,2,2}
        }, 1)); // 0
        System.out.println(prob.maxSideLength(new int[][]{
            {1,1,1,1},{1,0,0,0},{1,0,0,0},{1,0,0,0}
        }, 6)); // 3
        System.out.println(prob.maxSideLength(new int[][]{
            {18,70},{61,1},{25,85},{14,40},{11,96},{97,96},{63,45}
        }, 40184)); // 2
        System.out.println(prob.maxSideLength(new int[][]{
            {18,70},{61,1}
        }, 4)); // 1
        System.out.println(prob.maxSideLength(new int[][]{
            {18,70},{61,5}
        }, 4)); // 0
    }
}

@@ -424,32 +424,45 @@
 %7B1,1,3,2,4,3,2%7D,
+%0A            
 %7B1,1,3,2,4,3,2%7D,
@@ -461,16 +461,29 @@
 ,4,3,2%7D,
+%0A            
 %7B1,1,3,2
@@ -598,32 +598,71 @@
 ,2%7D,
-%7B2,2,2,2,2%7D,%7B2,2,2,2,2%7D,
+%0A            %7B2,2,2,2,2%7D,%0A            %7B2,2,2,2,2%7D,%0A            
 %7B2,2
@@ -775,28 +775,67 @@
 ,1%7D,
-%7B1,0,0,0%7D,%7B1,0,0,0%7D,
+%0A            %7B1,0,0,0%7D,%0A            %7B1,0,0,0%7D,%0A            
 %7B1,0
@@ -944,47 +944,125 @@
 70%7D,
-%7B61,1%7D,%7B25,85%7D,%7B14,40%7D,%7B11,96%7D,%7B97,96%7D,
+%0A            %7B61,1%7D,%0A            %7B25,85%7D,%0A            %7B14,40%7D,%0A            %7B11,96%7D,%0A            %7B97,96%7D,%0A            
 %7B63,
@@ -1165,24 +1165,37 @@
     %7B18,70%7D,
+%0A            
 %7B61,1%7D%0A     
@@ -1289,16 +1289,29 @@
 %7B18,70%7D,
+%0A            
 %7B61,5%7D%0A 

Update problem 1292