Given a square matrix
of integers, with size
,
its matrix minMax is a matrix
with size
such that for all
,
element mM[i][0] is the minimum element of the
-th
row of
and mM[i][1] is the maximum element of the
-th
column of
.
For instance, if M is the matrix
1 2 3
6 7 4
8 9 5
then mM will be:
1 8
4 9
5 5
Implement a function minMax(M) that given a square
matrix M returns its minMax matrix.
You can use the python min and max
functions to compute the maximum and minimum of a list.
Only the function is expected. Remember to comment out any testing main program you may have.
Author: Lluís Padró
Generation: 2026-01-25T20:01:46.469Z
© Jutge.org, 2006–2026.
https://jutge.org