The Question
CodingSpecial Positions in Binary Matrix
Given an m x n binary matrix, a cell (i, j) is defined as 'special' if mat[i][j] is 1 and all other elements in the i-th row and j-th column are 0. Write an efficient algorithm to calculate the total number of special positions in the matrix. Analyze the time and space complexity of your approach.
Java
Pre-computation
Array
March 20, 2026