Leetcode 1704 Solution
This article provides solution to leetcode question 1704 (special-positions-in-a-binary-matrix)
Access this page by simply typing in "lcs 1704" in your browser address bar if you have bunnylol configured.
Leetcode Question Link
class Solution: def numSpecial(self, mat: List[List[int]]) -> int: m = len(mat) n = len(mat) rows =  * m cols =  * n for i in range(m): for j in range(n): rows[i] += mat[i][j] cols[j] += mat[i][j] ans = 0 for i in range(m): for j in range(n): if mat[i][j] and rows[i] == 1 and cols[j] == 1: ans += 1 return ans