 Min-Max Matrix

Given a square matrix M of integers, with size n × n, n ≥ 1, its matrix
minMax is a matrix mM with size x × 2 such that for all i, 0 ≤ i ≤ n,
element mM[i][0] is the minimum element of the i-th row of M and
mM[i][1] is the maximum element of the i-th column of M.

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.

Observation

Only the function is expected. Remember to comment out any testing main
program you may have.

Problem information

Author: Lluís Padró

Generation: 2026-01-25T20:01:46.469Z

© Jutge.org, 2006–2026.
https://jutge.org
