Given a M x N matrix, write a program to print the matrix after ordering all the elements of the matrix in increasing order.
Expert's answer
matrix = []
line = input().split()
M = int(line[0])
N = int(line[1])
for _ inrange(0, M):
for i ininput().split():
matrix.append(int(i))
matrix.sort()
for i inrange(0, M):
for j inrange(0, N):
print(matrix[i*N:i*N+N][j],end=' ')
print()
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot