Given a M x N matrix, write a program to print the matrix after ordering all the elements of the matrix in increasing order.
1
Expert's answer
2021-07-14T13:07:06-0400
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()
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments