Tap here to switch tabs
Problem
Submissions

Problem: Special Positions in a Binary Matrix

med
30 min
Try to solve the Special Positions in a Binary Matrix problem.

Statement

Given an mimesnm imes n binary matrix mat, return the total number of special positions in mat.

A position (i, j) is considered special if mat[i][j] is equal to 11 and every other element in row i and column j is equal to 00, assuming rows and columns are 00 indexed.

Constraints:

  • m == mat.length

  • n == mat[i].length

  • 1≤1 \le m, n ≤100\le 100

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

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Special Positions in a Binary Matrix

med
30 min
Try to solve the Special Positions in a Binary Matrix problem.

Statement

Given an mimesnm imes n binary matrix mat, return the total number of special positions in mat.

A position (i, j) is considered special if mat[i][j] is equal to 11 and every other element in row i and column j is equal to 00, assuming rows and columns are 00 indexed.

Constraints:

  • m == mat.length

  • n == mat[i].length

  • 1≤1 \le m, n ≤100\le 100

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