Modify the input matrix mat [ ] using the above constructed row [ ] and col [ ] arrays
for i in range ( 0 , R ) : NEW_LINE INDENT for j in range ( 0 , C ) : NEW_LINE INDENT if ( row [ i ] == 1 or col [ j ] == 1 ) : NEW_LINE INDENT mat [ i ] [ j ] = 1 NEW_LINE DEDENT DEDENT DEDENT