Tap here to switch tabs
Problem
Submissions

Problem: Count Square Submatrices with All Ones

med
30 min
Try to solve the Count Square Submatrices with All Ones problem.

Statement

Given an mimesnm imes n binary matrix matrix, return the total number of square submatrices containing all 11s.

Constraints:

  • 1≤1 \leq matrix.length ≤300\leq 300

  • 1≤1 \leq matrix[0].length ≤300\leq 300

  • 0≤0 \leq matrix[i][j] ≤1\leq 1

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Square Submatrices with All Ones

med
30 min
Try to solve the Count Square Submatrices with All Ones problem.

Statement

Given an mimesnm imes n binary matrix matrix, return the total number of square submatrices containing all 11s.

Constraints:

  • 1≤1 \leq matrix.length ≤300\leq 300

  • 1≤1 \leq matrix[0].length ≤300\leq 300

  • 0≤0 \leq matrix[i][j] ≤1\leq 1