1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold

https://leetcode.com/problems/maximum-side-length-of-a-square-with-sum-less-than-or-equal-to-threshold

Description

Given a m x n matrix mat and an integer threshold. Return the maximum side-length of a square with a sum less than or equal to threshold or return 0 if there is no such square.

Example 1:

Example 2:

Example 3:

Example 4:

Constraints:

  • 1 <= m, n <= 300

  • m == mat.length

  • n == mat[i].length

  • 0 <= mat[i][j] <= 10000

  • 0 <= threshold <= 10^5

ac

Last updated

Was this helpful?