Class Solution
- java.lang.Object
-
- g1201_1300.s1292_maximum_side_length_of_a_square_with_sum_less_than_or_equal_to_threshold.Solution
-
public class Solution extends Object
1292 - Maximum Side Length of a Square with Sum Less than or Equal to Threshold.Medium
Given a
m x nmatrixmatand an integerthreshold, return the maximum side-length of a square with a sum less than or equal tothresholdor return0if there is no such square.Example 1:

Input: mat = [[1,1,3,2,4,3,2],[1,1,3,2,4,3,2],[1,1,3,2,4,3,2]], threshold = 4
Output: 2
Explanation: The maximum side length of square with sum less than 4 is 2 as shown.
Example 2:
Input: mat = [[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2],[2,2,2,2,2]], threshold = 1
Output: 0
Constraints:
m == mat.lengthn == mat[i].length1 <= m, n <= 3000 <= mat[i][j] <= 1040 <= threshold <= 105
-
-
Constructor Summary
Constructors Constructor Description Solution()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intmaxSideLength(int[][] mat, int threshold)
-