<garvit244>1267_1.py
def countServers( grid):
    if not grid:
        return 0
    
    row_count = [0] * len(grid)
    col_count = [0] * len(grid[0])
    for index_r in range(len(grid)):
        for index_c in range(len(grid[0])):
            if grid[index_r][index_c] == 1:
                row_count[index_r] += 1
                col_count[index_c] += 1
                
    result = 0
    for index_r in range(len(grid)):
        for index_c in range(len(grid[0])):
            if grid[index_r][index_c] == 1 and (row_count[index_r] > 1 or col_count[index_c] > 1):
                result += 1
    return result
def sample_funcname ( var_0 ) :
    if not var_0 :
        return 0
    var_3 = [ 0 ] * len ( var_0 )
    var_4 = [ 0 ] * len ( var_0 [ 0 ] )
    for var_6 in range ( len ( var_0 ) ) :
        for var_7 in range ( len ( var_0 [ 0 ] ) ) :
            if var_0 [ var_6 ] [ var_7 ] == 1 :
                var_3 [ var_6 ] += 1
                var_4 [ var_7 ] += 1
    var_9 = 0
    for var_6 in range ( len ( var_0 ) ) :
        for var_7 in range ( len ( var_0 [ 0 ] ) ) :
            if var_0 [ var_6 ] [ var_7 ] == 1 and ( var_3 [ var_6 ] > 1 or var_4 [ var_7 ] > 1 ) :
                var_9 += 1
    return var_9
