Modify the input matrix mat [ ] using the first row and first column of Matrix mat
for i in range ( 1 , len ( mat ) ) : NEW_LINE INDENT for j in range ( 1 , len ( mat ) + 1 ) : NEW_LINE INDENT if ( mat [ 0 ] [ j ] == 1 or mat [ i ] [ 0 ] == 1 ) : NEW_LINE INDENT mat [ i ] [ j ] = 1 NEW_LINE DEDENT DEDENT DEDENT