<doocs>1582.Special Positions in a Binary Matrix_1.py
def numSpecial( mat: List[List[int]]) -> int:
    m, n = len(mat), len(mat[0])
    r = [0] * m
    c = [0] * n
    for i, row in enumerate(mat):
        for j, v in enumerate(row):
            r[i] += v
            c[j] += v
    ans = 0
    for i in range(m):
        for j in range(n):
            if mat[i][j] == 1 and r[i] == 1 and c[j] == 1:
                ans += 1
    return ans
def sample_funcname ( var_0 : List [ List [ int ] ] ) -> int :
    var_4 , var_6 = len ( var_0 ) , len ( var_0 [ 0 ] )
    var_7 = [ 0 ] * var_4
    var_8 = [ 0 ] * var_6
    for var_10 , var_11 in enumerate ( var_0 ) :
        for var_12 , var_13 in enumerate ( var_11 ) :
            var_7 [ var_10 ] += var_13
            var_8 [ var_12 ] += var_13
    var_14 = 0
    for var_10 in range ( var_4 ) :
        for var_12 in range ( var_6 ) :
            if var_0 [ var_10 ] [ var_12 ] == 1 and var_7 [ var_10 ] == 1 and var_8 [ var_12 ] == 1 :
                var_14 += 1
    return var_14
