Tap here to switch tabs
Problem
Submissions

Problem: Count Submatrices With All Ones

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

Statement

Given an mimesnm imes n binary matrix mat, return the total number of submatrices that contain only 11s.

Constraints:

  • 1≤m,n≤1501 \leq m, n \leq 150

  • m == mat.length

  • n == mat[i].length

  • mat[i][j] is either 00 or 11.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Count Submatrices With All Ones

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

Statement

Given an mimesnm imes n binary matrix mat, return the total number of submatrices that contain only 11s.

Constraints:

  • 1≤m,n≤1501 \leq m, n \leq 150

  • m == mat.length

  • n == mat[i].length

  • mat[i][j] is either 00 or 11.